summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-01-12 13:44:55 -0500
committerLinus Groh <mail@linusgroh.de>2022-01-13 13:43:57 +0100
commit853ccab9af17a803fad19c3ba422e808171c5270 (patch)
treed6780370c37b68f28b88eea2753b37efeac8c087
parentc6f3856d4fdf9a1ef8217be083da01c682d97384 (diff)
downloadserenity-853ccab9af17a803fad19c3ba422e808171c5270.zip
LibJS: Remove unnecessary braces in Intl.DisplayNames
Just caught my eye as I was modifying this code.
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp
index 05af7040e9..b6769a4a94 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNames.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
+ * Copyright (c) 2021-2022, Tim Flynn <trflynn89@pm.me>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -19,15 +19,14 @@ DisplayNames::DisplayNames(Object& prototype)
void DisplayNames::set_style(StringView style)
{
- if (style == "narrow"sv) {
+ if (style == "narrow"sv)
m_style = Style::Narrow;
- } else if (style == "short"sv) {
+ else if (style == "short"sv)
m_style = Style::Short;
- } else if (style == "long"sv) {
+ else if (style == "long"sv)
m_style = Style::Long;
- } else {
+ else
VERIFY_NOT_REACHED();
- }
}
StringView DisplayNames::style_string() const
@@ -46,17 +45,16 @@ StringView DisplayNames::style_string() const
void DisplayNames::set_type(StringView type)
{
- if (type == "language"sv) {
+ if (type == "language"sv)
m_type = Type::Language;
- } else if (type == "region"sv) {
+ else if (type == "region"sv)
m_type = Type::Region;
- } else if (type == "script"sv) {
+ else if (type == "script"sv)
m_type = Type::Script;
- } else if (type == "currency"sv) {
+ else if (type == "currency"sv)
m_type = Type::Currency;
- } else {
+ else
VERIFY_NOT_REACHED();
- }
}
StringView DisplayNames::type_string() const
@@ -77,13 +75,12 @@ StringView DisplayNames::type_string() const
void DisplayNames::set_fallback(StringView fallback)
{
- if (fallback == "none"sv) {
+ if (fallback == "none"sv)
m_fallback = Fallback::None;
- } else if (fallback == "code"sv) {
+ else if (fallback == "code"sv)
m_fallback = Fallback::Code;
- } else {
+ else
VERIFY_NOT_REACHED();
- }
}
StringView DisplayNames::fallback_string() const