Utils: Improve SmallString

The small string control block moved to the beginning, so it is more cache
local. The control block is cleanup too, so it should be easier to read.
The alignment is removed because it is creating to big holes.

Change-Id: I401aeb9d55455cbaa5e722dd8192e54b525ddc40
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-03-26 17:10:17 +02:00
parent 0ecd543614
commit b6cb22899c
6 changed files with 167 additions and 95 deletions

View File

@@ -79,6 +79,12 @@ public:
{
}
SmallStringView(const const_iterator begin, const const_iterator end) noexcept
: m_pointer(begin.data()),
m_size(std::size_t(end - begin))
{
}
template<typename String,
typename Utils::enable_if_has_char_data_pointer<String> = 0>
SmallStringView(const String &string) noexcept