diff options
author | Lenny Maiorani <lenny@serenityos.org> | 2022-03-13 16:09:41 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-18 19:58:57 +0100 |
commit | f912a48315c425ff49fb9421f58ea5bb834a96d6 (patch) | |
tree | 3a07abae47052211701d97e0246d62f162adb295 /Userland/Libraries/LibGUI/CheckBox.cpp | |
parent | 31515a9147459d29f871d8dedfdc9a4072a9900d (diff) | |
download | serenity-f912a48315c425ff49fb9421f58ea5bb834a96d6.zip |
Userland: Change static const variables to static constexpr
`static const` variables can be computed and initialized at run-time
during initialization or the first time a function is called. Change
them to `static constexpr` to ensure they are computed at
compile-time.
This allows some removal of `strlen` because the length of the
`StringView` can be used which is pre-computed at compile-time.
Diffstat (limited to 'Userland/Libraries/LibGUI/CheckBox.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/CheckBox.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/CheckBox.cpp b/Userland/Libraries/LibGUI/CheckBox.cpp index 207df1f0c0..7afb815efb 100644 --- a/Userland/Libraries/LibGUI/CheckBox.cpp +++ b/Userland/Libraries/LibGUI/CheckBox.cpp @@ -16,9 +16,9 @@ REGISTER_WIDGET(GUI, CheckBox) namespace GUI { -static const int s_box_width = 13; -static const int s_box_height = 13; -static const int s_horizontal_padding = 6; +static constexpr int s_box_width = 13; +static constexpr int s_box_height = 13; +static constexpr int s_horizontal_padding = 6; CheckBox::CheckBox(String text) : AbstractButton(move(text)) |