This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Rewrite Enum.CompareTo in C# #27792
Merged
Merged
Rewrite Enum.CompareTo in C# #27792
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkotas
commented
Nov 9, 2019
| switch (this.InternalGetCorElementType()) | ||
| { | ||
| case CorElementType.ELEMENT_TYPE_I1: | ||
| return Unsafe.As<byte, sbyte>(ref pThisValue).CompareTo(Unsafe.As<byte, sbyte>(ref pTargetValue)); |
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a minor observable change - the return value is not normalized to 1/0/-1. This should be acceptable. We have done similar changes for other CompareTo methods in .NET Core.
stephentoub
approved these changes
Nov 9, 2019
AaronRobinsonMSFT
approved these changes
Nov 9, 2019
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/corefx
that referenced
this pull request
Nov 11, 2019
* Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/corert
that referenced
this pull request
Nov 11, 2019
* Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]>
Dotnet-GitSync-Bot
pushed a commit
to Dotnet-GitSync-Bot/mono
that referenced
this pull request
Nov 11, 2019
* Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]>
stephentoub
pushed a commit
to dotnet/corefx
that referenced
this pull request
Nov 11, 2019
* Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]>
jkotas
added a commit
to dotnet/corert
that referenced
this pull request
Nov 12, 2019
* Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]>
pentp
reviewed
Nov 12, 2019
| if (this == null) | ||
| throw new NullReferenceException(); | ||
|
|
||
| int ret = InternalCompareTo(this, target); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could delete the InternalCompareTo method declaration from this file also.
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#27837 Thanks!
vargaz
pushed a commit
to mono/mono
that referenced
this pull request
Nov 12, 2019
* Rewrite the rest of the array non-generic fast paths in C# (#27703) * Rewrite the rest of the array non-generic fast paths in C# * Add missing resource string * Use CorElementType and handle native ints to match the unmanaged implementation * Avoid try pattern for Sort and Reverse * Match the native implementation more closely Signed-off-by: dotnet-bot <[email protected]> * Rewrite Enum.CompareTo in C# (dotnet/coreclr#27792) * Rewrite Enum.CompareTo in C# * Handle floating point too for match the existing native implementation Signed-off-by: dotnet-bot <[email protected]> * Remove unused argument from GetRegionDisplayName (dotnet/coreclr#27806) * Remove unused argument from GetRegionDisplayName * Address race conditions in CultureData While most of the race conditions in this file are benign, in these cases, a thread could end up returning an intermediate value due to multiple potential writes to the same field. Signed-off-by: dotnet-bot <[email protected]> * Fix StyleCop rule SA1129 ("Do not use default value type constructor") (#27716) Will enable the rule in corefx once these changes have propagated. Signed-off-by: dotnet-bot <[email protected]> * Remove non-shared Enum.CompareTo/InternalCompareTo implementation, add new Array icalls used by shared code
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.