diff --git a/deps/ox/src/ox/std/uuid.hpp b/deps/ox/src/ox/std/uuid.hpp index 031222be..f3ea2131 100644 --- a/deps/ox/src/ox/std/uuid.hpp +++ b/deps/ox/src/ox/std/uuid.hpp @@ -175,28 +175,9 @@ class UUID { [[nodiscard]] constexpr UUIDStr toString() const noexcept { UUIDStr out; - auto valueI = 0u; - constexpr auto printChars = []( - UUIDStr *out, - const Array &value, - std::size_t cnt, - unsigned &valueI) { - for (auto i = 0u; i < cnt; ++i) { - const auto v = value[valueI]; - const auto h = detail::toHex(v); - oxIgnoreError(out->append(h.c_str(), h.len())); - ++valueI; - } - }; - printChars(&out, m_value, 4, valueI); - out += "-"; - printChars(&out, m_value, 2, valueI); - out += "-"; - printChars(&out, m_value, 2, valueI); - out += "-"; - printChars(&out, m_value, 2, valueI); - out += "-"; - printChars(&out, m_value, 6, valueI); + ox::CharBuffWriter bw(out.data(), out.cap()); + oxIgnoreError(toString(bw)); + out[out.cap()] = 0; return out; } };