Utils: fix narrowing warning

We test the small string capacity anyway, so we never write a larger
size.

Change-Id: Ie3a2f907898229fdee6219149917d9fddd3297e6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marco Bubke
2022-08-18 13:21:53 +02:00
parent c7cdd55dea
commit 550dadb86e

View File

@@ -43,12 +43,14 @@ template <uint MaximumShortStringDataAreaSize,
typename ControlType = typename std::conditional_t<(MaximumShortStringDataAreaSize < 64), uint8_t, uint16_t>> typename ControlType = typename std::conditional_t<(MaximumShortStringDataAreaSize < 64), uint8_t, uint16_t>>
struct ControlBlock struct ControlBlock
{ {
using SizeType = ControlType; using SizeType = ControlType;
constexpr ControlBlock() noexcept = default; constexpr ControlBlock() noexcept = default;
constexpr ControlBlock(ControlType shortStringSize, bool isReadOnlyReference, bool isReference) noexcept constexpr ControlBlock(size_type shortStringSize,
: m_shortStringSize(shortStringSize), bool isReadOnlyReference,
m_isReadOnlyReference(isReadOnlyReference), bool isReference) noexcept
m_isReference(isReference) : m_shortStringSize(static_cast<SizeType>(shortStringSize))
, m_isReadOnlyReference(isReadOnlyReference)
, m_isReference(isReference)
{} {}
constexpr void setShortStringSize(size_type size) constexpr void setShortStringSize(size_type size)