Open Janiczek opened 5 years ago
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.
newOffset + smallString.length
-- v = newOffset "Is 42 the answer?" -- ^ = newOffset + smallString.length -- 1234567...
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.