mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
31515a9147
commit
f912a48315
@@ -1,16 +1,18 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibRegex/Regex.h>
|
||||
#include <LibSQL/AST/AST.h>
|
||||
#include <LibSQL/Database.h>
|
||||
|
||||
namespace SQL::AST {
|
||||
|
||||
static const String s_posix_basic_metacharacters = ".^$*[]+\\";
|
||||
static constexpr StringView s_posix_basic_metacharacters = ".^$*[]+\\";
|
||||
|
||||
ResultOr<Value> NumericLiteral::evaluate(ExecutionContext&) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user