3 ms·
Yes, and it includes that guarantee because it was designed with UCS-2 in mind. The question is what would have happened if, hypothetically, the mistake of UCS
by comex 7y ago
Yes, and it includes that guarantee because it was designed with UCS-2 in mind. The question is what would have happened if, hypothetically, the mistake of UCS-2 had never been made.
- jrochkind1 7y agoWell, you can't get that easy O(1) charAt with UTF-8 either, so I think it'd actually be in the same spot, is what I'm saying. I think. I guess perhaps it wouldn't ever have said it provided a charAt in O(1), okay. It may have been a mistake to think this mattered, it was just offered because it was easy. In which case I suspect there are actually few programs which would be negatively affected by changing charAt to the most efficient you can do in UTF8. UTF-32 of course has the O(1) property, but nobody wants that memory usage.