Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix missing casts in Enumerable.Select assert#37699

Merged
stephentoub merged 1 commit intodotnet:masterfrom
timandy:linqfix
May 17, 2019
Merged

Fix missing casts in Enumerable.Select assert#37699
stephentoub merged 1 commit intodotnet:masterfrom
timandy:linqfix

Conversation

@timandy
Copy link
Copy Markdown
Contributor

@timandy timandy commented May 16, 2019

Fix #37410 missed casts.

Comment thread src/System.Linq/src/System/Linq/Select.SpeedOpt.cs Outdated
Copy link
Copy Markdown
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit to be addressed, otherwise LGTM. Thanks.

@stephentoub stephentoub changed the title Fix the missing casts Fix missing casts in Enumerable.Select assert May 16, 2019
{
Debug.Assert(start < end);
Debug.Assert((end - start) <= int.MaxValue);
Debug.Assert(unchecked((uint)(end - start) <= (uint)int.MaxValue));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Debug.Assert(unchecked((uint)(end - start) <= (uint)int.MaxValue));
Debug.Assert((uint)(end - start) <= (uint)int.MaxValue);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will force push to change the commit.

@stephentoub
Copy link
Copy Markdown
Member

Thanks!

@stephentoub stephentoub merged commit 6f9570e into dotnet:master May 17, 2019
@timandy timandy deleted the linqfix branch May 20, 2019 01:17
@karelz karelz added this to the 3.0 milestone May 22, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants