[m-rev.] for review: improve dir./
Zoltan Somogyi
zoltan.somogyi at runbox.com
Mon Sep 11 13:03:23 AEST 2023
On 2023-09-11 12:59 +10:00 AEST, "Peter Wang" <novalazy at gmail.com> wrote:
> I mean that depite the name, unsafe_index_next is not full of footguns
> (at least, I don't think so). The usual pattern is to start from index 0,
> then iterate through the string using the index returned by the previous
> call to unsafe_index_next; that's safe.
I don't see how that will work, since that can just plow through
the end of the string and keep going. You would need to compute
the string length once, and stop when you get there. That is very similar
to what the old code did.
Zoltan.
More information about the reviews
mailing list