It seems like this would always be false.  In the only call to this, lastSegmentSpecialsIndex is passed for startingSpecial, so `specials[startingSpecial] == lastSegmentStart`, and thus `extraCharacters == lastSegmentStart + query.length - str.length`.  Since it's called in a block where `lastSegmentStart + query.length < str.length`, I think extraChars must always be negative...