3 ms·
> The first is useful for basic string operations. The only thing it's useful for is sizing up storage. It does nothing for "basic string operations" unless "b
by masklinn 6y ago
> The first is useful for basic string operations.
The only thing it's useful for is sizing up storage. It does nothing for "basic string operations" unless "basic string operations" are solely 7-bit ascii manipulations.
- ChrisSD 6y agoIt's useful for any and all operations that involve indexing a range. Yes you locate the specific indexes by using extended grapheme clusters, but you use the retrieved byte indexes to actually perform the basic operations. These indexes can also be cached so you don't have to recalculate their byte position every time (so long as the string isn't modified).
- deleted 6y ago[deleted]
- masklinn 6y ago> It's useful for any and all operations that involve indexing a range. That has little to do with the string length, those indices can be completely opaque for all you care. > Yes you locate the specific indexes by using extended grapheme clusters Do you? I'd expect that the indices are mostly located using some sort of pattern matching.