1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57:44 +00:00

AK: Make "foo"_fly_string infallible

Stop worrying about tiny OOMs.

Work towards #20405.
This commit is contained in:
Andreas Kling 2023-08-07 12:07:35 +02:00
parent 34344120f2
commit 25eee91811
30 changed files with 59 additions and 72 deletions

View file

@ -12,18 +12,17 @@ namespace Web::WebGL::EventNames {
ENUMERATE_GL_EVENTS
#undef __ENUMERATE_GL_EVENT
ErrorOr<void> initialize_strings()
void initialize_strings()
{
static bool s_initialized = false;
VERIFY(!s_initialized);
#define __ENUMERATE_GL_EVENT(name) \
name = TRY(#name##_fly_string);
name = #name##_fly_string;
ENUMERATE_GL_EVENTS
#undef __ENUMERATE_GL_EVENT
s_initialized = true;
return {};
}
}