forked from qt-creator/qt-creator
Utils: Fix small string
Change-Id: I94b9cd4c282bf57254b52172658135237d4073bd Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -464,9 +464,11 @@ public:
|
|||||||
|
|
||||||
reserve(optimalCapacity(newSize));
|
reserve(optimalCapacity(newSize));
|
||||||
|
|
||||||
std::memcpy(data() + oldSize, temporaryArray, newAppendedStringSize);
|
auto begin = data();
|
||||||
|
|
||||||
newEnd = data() + newSize;
|
std::memcpy(begin + oldSize, temporaryArray, newAppendedStringSize);
|
||||||
|
|
||||||
|
newEnd = begin + newSize;
|
||||||
}
|
}
|
||||||
setSize(newEnd - data());
|
setSize(newEnd - data());
|
||||||
}
|
}
|
||||||
|
@@ -281,7 +281,7 @@ struct alignas(16) StringDataLayout<MaximumShortStringDataAreaSize,
|
|||||||
|
|
||||||
constexpr void reset() noexcept
|
constexpr void reset() noexcept
|
||||||
{
|
{
|
||||||
pointer = nullptr;
|
pointer = buffer;
|
||||||
size_ = 0;
|
size_ = 0;
|
||||||
capacity_ = MaximumShortStringDataAreaSize;
|
capacity_ = MaximumShortStringDataAreaSize;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user