summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser
diff options
context:
space:
mode:
authorLenny Maiorani <lenny@serenityos.org>2022-02-09 17:45:15 -0700
committerAndreas Kling <kling@serenityos.org>2022-02-28 13:54:27 +0100
commit1dd70a6f490da6222478d4f0ba5f069a26a13104 (patch)
tree19b137f2908cc22bc71bedc7190f422efc1c3ef8 /Userland/Applications/Browser
parent7012a5eb0b513ac3c2b4c4f4e69adf163098a984 (diff)
downloadserenity-1dd70a6f490da6222478d4f0ba5f069a26a13104.zip
Applications: Change static constexpr variables to constexpr
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations.
Diffstat (limited to 'Userland/Applications/Browser')
-rw-r--r--Userland/Applications/Browser/CookieJar.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp
index 868ffb76d9..cb65e7963d 100644
--- a/Userland/Applications/Browser/CookieJar.cpp
+++ b/Userland/Applications/Browser/CookieJar.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
+ * Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -7,6 +8,7 @@
#include "CookieJar.h"
#include <AK/IPv4Address.h>
#include <AK/StringBuilder.h>
+#include <AK/StringView.h>
#include <AK/URL.h>
#include <AK/Vector.h>
#include <LibWeb/Cookie/ParsedCookie.h>
@@ -48,9 +50,9 @@ void CookieJar::set_cookie(const URL& url, const Web::Cookie::ParsedCookie& pars
void CookieJar::dump_cookies() const
{
- static const char* key_color = "\033[34;1m";
- static const char* attribute_color = "\033[33m";
- static const char* no_color = "\033[0m";
+ constexpr StringView key_color = "\033[34;1m";
+ constexpr StringView attribute_color = "\033[33m";
+ constexpr StringView no_color = "\033[0m";
StringBuilder builder;
builder.appendff("{} cookies stored\n", m_cookies.size());