this matches what you did in your polyfill anyways, and makes the algorithm cleaner imo.
If having "the length of bytes" in there is weird, then my fallback would be, changing the return in step 6.f.i to set index = length so the return point isn't repeated, but that's a lot more subjective of an improvement to be fair.
this matches what you did in your polyfill anyways, and makes the algorithm cleaner imo.
If having "the length of bytes" in there is weird, then my fallback would be, changing the return in step 6.f.i to
set index = length
so the return point isn't repeated, but that's a lot more subjective of an improvement to be fair.