From 80dbc25b6d2e9919a725974ca0d4a1a8052e6991 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Sat, 7 Dec 2019 15:56:44 +0100 Subject: [PATCH] Fix typo in overflow check License: MIT Signed-off-by: Jakub Sztandera --- lib/rlepluslazy/runs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rlepluslazy/runs.go b/lib/rlepluslazy/runs.go index c8ae36644..be2ed5bcc 100644 --- a/lib/rlepluslazy/runs.go +++ b/lib/rlepluslazy/runs.go @@ -110,7 +110,7 @@ func Count(ri RunIterator) (uint64, error) { return 0, err } if r.Val { - if math.MaxUint64-r.Len > count { + if math.MaxUint64-r.Len < count { return 0, xerrors.New("RLE+ overflows") } count += r.Len