Skip to content

Commit 055aada

Browse files
Merge pull request #77 from proost/fix-underflow
fix: underflow
2 parents e59fd90 + 80ac30a commit 055aada

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tuple/intersection.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ func NewIntersection[S Summary](policy Policy[S], opts ...IntersectionOptionFunc
6060
0, 0, theta.ResizeX1, 1.0, theta.MaxTheta, options.seed, false,
6161
),
6262
entryLessFunc: func(a, b entry[S]) int {
63-
return int(a.Hash) - int(b.Hash)
63+
if a.Hash < b.Hash {
64+
return -1
65+
} else if a.Hash > b.Hash {
66+
return 1
67+
}
68+
return 0
6469
},
6570
policy: policy,
6671
isValid: false,

0 commit comments

Comments
 (0)