Skip to content

Commit

Permalink
Set: optimize comparer: Set.Compare returns only [-1,0,1]
Browse files Browse the repository at this point in the history
  • Loading branch information
buybackoff committed Jan 10, 2021
1 parent 3386a33 commit 0900934
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fsharp/FSharp.Core/set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ module internal SetTree =
else -1
else
if isEmpty t2 then 1
else compareStacks [t1] [t2]
else
let c = compareStacks [t1] [t2]
if c > 0 then 1 else if c = 0 then 0 else -1

let choose s =
minimumElement s
Expand Down

0 comments on commit 0900934

Please sign in to comment.