};
SmallStringsStorage::SmallStringsStorage()
+ : m_base(m_characters, numCharactersToStore)
{
- for (unsigned i = 0; i < numCharactersToStore; ++i)
- m_characters[i] = i;
-
m_base.rc = numCharactersToStore + 1;
- m_base.buf = m_characters;
- m_base.len = numCharactersToStore;
- m_base.offset = 0;
- m_base._hash = 0;
- m_base.m_baseString = 0;
- m_base.preCapacity = 0;
- m_base.usedPreCapacity = 0;
- m_base.reportedCost = 0;
-
// make sure UString doesn't try to reuse the buffer by pretending we have one more character in it
m_base.usedCapacity = numCharactersToStore + 1;
m_base.capacity = numCharactersToStore + 1;
m_base.checkConsistency();
+ for (unsigned i = 0; i < numCharactersToStore; ++i)
+ m_characters[i] = i;
+
memset(&m_reps, 0, sizeof(m_reps));
for (unsigned i = 0; i < numCharactersToStore; ++i) {
m_reps[i].offset = i;