fix failing unit test in search-list.sml/build-search-list.sml: perform bounds checking into array

This commit is contained in:
2025-08-04 08:33:48 +01:00
parent d4532e37cf
commit f4c9039af1
3 changed files with 22 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ struct
case rightStrings of
hd :: tl =>
let
val strIdx = absIdx - bufferIdx
val strIdx = Int.max (0, absIdx - bufferIdx)
in
if strIdx < String.size hd then
helpNextMatch (strIdx, hd, tl, absIdx, searchString, 0)