Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e851c6

Browse files
vasily-kirichenkoTIHan
authored andcommitted
Provide fast generic comparer for bool values (dotnet#5076)
* provide fast generic comparer for bool values* formatting
1 parent5bfd9fc commit0e851c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/fsharp/FSharp.Core/prim-types.fs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,7 @@ namespace Microsoft.FSharp.Core
21622162
letFloatComparer= MakeGenericComparer<float>()
21632163
letFloat32Comparer= MakeGenericComparer<float32>()
21642164
letDecimalComparer= MakeGenericComparer<decimal>()
2165+
letBoolComparer= MakeGenericComparer<bool>()
21652166

21662167
/// Use a type-indexed table to ensure we only create a single FastStructuralComparison function
21672168
/// for each type
@@ -2199,6 +2200,7 @@ namespace Microsoft.FSharp.Core
21992200
| tywhen ty.Equals(typeof<float32>)->null
22002201
| tywhen ty.Equals(typeof<decimal>)->null
22012202
| tywhen ty.Equals(typeof<string>)-> unboxPrim(box StringComparer)
2203+
| tywhen ty.Equals(typeof<bool>)->null
22022204
|_-> MakeGenericComparer<'T>()
22032205

22042206
static letf:System.Collections.Generic.IComparer<'T>=
@@ -2218,6 +2220,7 @@ namespace Microsoft.FSharp.Core
22182220
| tywhen ty.Equals(typeof<float32>)-> unboxPrim(box Float32Comparer)
22192221
| tywhen ty.Equals(typeof<decimal>)-> unboxPrim(box DecimalComparer)
22202222
| tywhen ty.Equals(typeof<string>)-> unboxPrim(box StringComparer)
2223+
| tywhen ty.Equals(typeof<bool>)-> unboxPrim(box BoolComparer)
22212224
|_->
22222225
// Review: There are situations where we should be able
22232226
// to return System.Collections.Generic.Comparer<'T>.Default here.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp