parser icon indicating copy to clipboard operation
parser copied to clipboard

Fix comment in `findSubString`

Open Janiczek opened this issue 5 years ago • 0 comments

This comment isn't in line with what the code actually does, and given code can't lie but comments can, the place to fix is probably the comment.

See findSubString - the newOffset + smallString.length means the target is pointed at the end of the found substring, not at its beginning.

--    v = newOffset
  "Is 42 the answer?"
--      ^ = newOffset + smallString.length
-- 1234567...

Janiczek avatar Jul 21 '19 17:07 Janiczek