Closed dy closed 4 years ago
wouldn't this:
while (--n >= dif && b[n] == a[n - dif]) end = b[n]
be smaller as such? 🤔
while (n-- > dif && b[n] == a[n - dif]) end = b[n]
@WebReflection replaced dif
with n
/m
for aLength
/bLength
from your example - it still had risk of a
overshoot on initial check. Also a bit less cryptic.
this looks good to me, not sure you need to adjust anything else, but feel free to merge 👋
With considerations from #35 by @WebReflection (safe array access), also with added tail-skip. It bumps from 208 → 251 bytes, but makes prepend faster and safer array deoptimization.