startOfSuffix() can be much simplified by using `.lastIndex`?

It's not generally problematic, but it's unnecessary work. For the Algorithms package and the Standard Library, there's rarely a good excuse for doing unnecessary work. As Karoy said:

It would be really unfortunate if someone had to re-implement one of our algorithms to be faster because we had opted for a slightly more concise but less efficient solution.

1 Like