Fix typo in overflow check

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2019-12-07 15:56:44 +01:00
parent 6e4761c819
commit 80dbc25b6d
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA

View File

@ -110,7 +110,7 @@ func Count(ri RunIterator) (uint64, error) {
return 0, err return 0, err
} }
if r.Val { if r.Val {
if math.MaxUint64-r.Len > count { if math.MaxUint64-r.Len < count {
return 0, xerrors.New("RLE+ overflows") return 0, xerrors.New("RLE+ overflows")
} }
count += r.Len count += r.Len