summaryrefslogtreecommitdiff
path: root/source/fud_string.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/fud_string.cpp')
-rw-r--r--source/fud_string.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/fud_string.cpp b/source/fud_string.cpp
index 777212d..d4fd691 100644
--- a/source/fud_string.cpp
+++ b/source/fud_string.cpp
@@ -241,9 +241,9 @@ String& String::operator=(String&& rhs) noexcept
void String::cleanup()
{
- const auto* allocPtr = allocator();
+ auto* allocPtr = allocator();
if (isLarge() && m_repr.large.data != nullptr && allocPtr != nullptr) {
- allocator()->deallocate(std::bit_cast<std::byte*>(m_repr.large.data), m_repr.large.capacity);
+ allocPtr->deallocate(std::bit_cast<std::byte*>(m_repr.large.data), m_repr.large.capacity);
m_repr.large.data = nullptr;
}
}
@@ -816,8 +816,7 @@ FudStatus String::makeLarge(size_t cap, size_t len, utf8*& outputData)
if (dataResult.isError()) {
return dataResult.getError();
}
- // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast)
- m_repr.large.data = reinterpret_cast<utf8*>(dataResult.getOkay());
+ m_repr.large.data = std::bit_cast<utf8*>(dataResult.getOkay());
outputData = m_repr.large.data;
setLarge();
return FudStatus::Success;