My only reservation is that (I believe), this test should actually be `if (startIdx <= s.length)`. This is for the border case of `indexOf("", "", 0)`. Arguably, the correct return should be `0`. Right now, `indexOf("", "")` returns `-1` anyways, but that's a bug (IMO).

By keeping it to `if (startIdx <= s.length)`, then we can guarantee we get 100% same behavior between both functions, which is always good. And if `indexOf` gets fixed, so will this one.

Worst case scenario, this is really just an edge test case anyways, should you should see virtually no change in performance.