MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getUTF32Index

Method getUTF32Index

valdi_core/src/valdi_core/cpp/Text/UTF16Utils.cpp:285–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285size_t UTF16ToUTF32Index::getUTF32Index(size_t utf16Index) const {
286 size_t utf32Index = utf16Index;
287
288 for (size_t offsetIndex = 0; offsetIndex < _offsets.size(); offsetIndex++) {
289 auto utf32Position = _offsets.data()[offsetIndex];
290
291 if (utf32Position >= utf32Index) {
292 break;
293 }
294
295 utf32Index--;
296 }
297
298 return utf32Index;
299}
300
301} // namespace Valdi

Callers 2

TESTFunction · 0.80
resolveParagraphsICUMethod · 0.80

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by 1

TESTFunction · 0.64