MCPcopy Create free account
hub / github.com/KDE/kdevelop / indexForString

Method indexForString

kdevplatform/serialization/indexedstring.cpp:408–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408uint IndexedString::indexForString(const char* str, short unsigned length, uint hash)
409{
410 if (!length) {
411 return 0;
412 } else if (length == 1) {
413 return charToIndex(str[0]);
414 } else {
415 const auto request = IndexedStringRepositoryItemRequest(str, hash ? hash : hashString(str, length), length);
416 return LockedItemRepository::write<IndexedString>([request](IndexedStringRepository& repo) {
417 return repo.index(request);
418 });
419 }
420}
421
422uint IndexedString::indexForString(const QString& str, uint hash)
423{

Callers

nothing calls this directly

Calls 5

charToIndexFunction · 0.85
constBeginMethod · 0.80
indexMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected