mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:47:35 +00:00
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.
This commit is contained in:
parent
7012a5eb0b
commit
1dd70a6f49
10 changed files with 67 additions and 60 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue