| 381 | } |
| 382 | |
| 383 | QByteArray IndexedString::byteArray() const |
| 384 | { |
| 385 | if (!m_index) { |
| 386 | return QByteArray(); |
| 387 | } else if (isSingleCharIndex(m_index)) { |
| 388 | return QByteArray(1, indexToChar(m_index)); |
| 389 | } else { |
| 390 | const uint index = m_index; |
| 391 | return LockedItemRepository::read<IndexedString>([index](const IndexedStringRepository& repo) { |
| 392 | return arrayFromItem(repo.itemFromIndex(index)); |
| 393 | }); |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | uint IndexedString::hashString(const char* str, unsigned short length) |
| 398 | { |