summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-06-10 08:24:39 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-06-10 08:26:53 +0900
commitdfee7af57b0de51c0f1bb815da1be071978e8675 (patch)
treefe522e20b6daab9c8ee9a9a2243e2ad14c06c791 /src
parent9b0e2daf02410e956f4d9d41055753f786da3270 (diff)
Fix divide by zero error with --tiebreak=end for long itemsHEADmaster
Fix #3846
Diffstat (limited to 'src')
-rw-r--r--src/result.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/result.go b/src/result.go
index b9e737de..e1c20801 100644
--- a/src/result.go
+++ b/src/result.go
@@ -81,7 +81,7 @@ func buildResult(item *Item, offsets []Offset, score int) Result {
if criterion == byBegin {
val = util.AsUint16(minEnd - whitePrefixLen)
} else {
- val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/int(item.TrimLength()+1))
+ val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/(int(item.TrimLength())+1))
}
}
}