mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
Everywhere: Remove all KERNEL #defines
This commit is contained in:
committed by
Andreas Kling
parent
de99dd2c89
commit
5ca2f4dfd7
22
AK/UUID.cpp
22
AK/UUID.cpp
@@ -76,27 +76,6 @@ UUID::UUID(StringView uuid_string_view, Endianness endianness)
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
#ifdef KERNEL
|
||||
ErrorOr<NonnullOwnPtr<Kernel::KString>> UUID::to_string() const
|
||||
{
|
||||
StringBuilder builder(36);
|
||||
auto nibble0 = TRY(encode_hex(m_uuid_buffer.span().trim(4)));
|
||||
TRY(builder.try_append(nibble0->view()));
|
||||
TRY(builder.try_append('-'));
|
||||
auto nibble1 = TRY(encode_hex(m_uuid_buffer.span().slice(4).trim(2)));
|
||||
TRY(builder.try_append(nibble1->view()));
|
||||
TRY(builder.try_append('-'));
|
||||
auto nibble2 = TRY(encode_hex(m_uuid_buffer.span().slice(6).trim(2)));
|
||||
TRY(builder.try_append(nibble2->view()));
|
||||
TRY(builder.try_append('-'));
|
||||
auto nibble3 = TRY(encode_hex(m_uuid_buffer.span().slice(8).trim(2)));
|
||||
TRY(builder.try_append(nibble3->view()));
|
||||
TRY(builder.try_append('-'));
|
||||
auto nibble4 = TRY(encode_hex(m_uuid_buffer.span().slice(10).trim(6)));
|
||||
TRY(builder.try_append(nibble4->view()));
|
||||
return Kernel::KString::try_create(builder.string_view());
|
||||
}
|
||||
#else
|
||||
ErrorOr<String> UUID::to_string() const
|
||||
{
|
||||
auto buffer_span = m_uuid_buffer.span();
|
||||
@@ -112,7 +91,6 @@ ErrorOr<String> UUID::to_string() const
|
||||
TRY(builder.try_append(encode_hex(buffer_span.slice(10, 6))));
|
||||
return builder.to_string();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool UUID::is_zero() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user