3 ms·
Correct, i seem to have quoted the wrong part of the GP comment... I meant to address this quote: > adding a special flag to indicate all characters in the str
by ninkendo 7y ago
Correct, i seem to have quoted the wrong part of the GP comment... I meant to address this quote:
> adding a special flag to indicate all characters in the string are ASCII, so that we can still use O(1) indexing in this case
But I got confused and addressed the linear indexing part.
But yeah, ASCII is constant time, but you can’t assume even UTF-32 can be constant time due to variable length grapheme clusters.