Skip to content

Commit

Permalink
Fix the possible loss of precision when the key is Uint64 or Int64
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhxyy committed Mar 16, 2021
1 parent 190cbbe commit 1950c87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func compareTypes(lhs, rhs reflect.Value, kind reflect.Kind) int {
return 0

case reflect.Uint64:
v1 := uint64(lhs.Int())
v2 := uint64(rhs.Int())
v1 := uint64(lhs.Uint())
v2 := uint64(rhs.Uint())

if v1 > v2 {
return 1
Expand Down

0 comments on commit 1950c87

Please sign in to comment.