You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Apparently, in .NET 5.0 Preview 6, value.EndsWith("\0") returns true for all strings (unlike all other .NET platforms). Looks like an unintended side effect or a bug.
@lukaaash This is not a bug. in .NET 5.0 we have started to use ICU which has slight collation behavior than Windows NLS. '\0' doesn't have any sort weight. If you don't like this behavior, you may consider using Ordinal comparison instead.
@tarekgh@safern Thanks for the explanation and for the link! (In our code where this did cause a problem, we should actually have been using Ordinal comparison anyway.)
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
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.
By reusing the code from #26621 I was able to get similar improvements for
EndsWith/IsSuffix.Using these benchmarks from performance repo we can see that:
BenchmarkDotNet=v0.11.5.1188-nightly, OS=ubuntu 18.04
Intel Xeon CPU E5-2673 v4 2.30GHz, 1 CPU, 4 logical and 2 physical cores
.NET Core SDK=3.1.100-preview1-014415
[Host] : .NET Core 3.1.0 (CoreCLR 4.700.19.50102, CoreFX 4.700.19.50108), X64 RyuJIT
Job-OCNEHW : .NET Core 5.0.0 (CoreCLR 5.0.19.50201, CoreFX 5.0.19.47707), X64 RyuJIT
Job-GGISEQ : .NET Core 5.0.0 (CoreCLR 5.0.19.48001, CoreFX 5.0.19.47707), X64 RyuJIT
PowerPlanMode=00000000-0000-0000-0000-000000000000 IterationTime=250.0000 ms MaxIterationCount=20
MinIterationCount=15 WarmupCount=1