mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
LibC: Remove static from function local constexpr variable
Problem: - Function local `constexpr` variables do not need to be `static`. This consumes memory which is unnecessary and can prevent some optimizations. Solution: - Remove `static` keyword.
This commit is contained in:
parent
44a9c7c23e
commit
31d24d8292
Notes:
sideshowbarker
2024-07-18 17:53:33 +09:00
Author: https://github.com/ldm5180 Commit: https://github.com/SerenityOS/serenity/commit/31d24d82925 Pull-request: https://github.com/SerenityOS/serenity/pull/7234
2 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,7 @@ inline int generate_unique_filename(char* pattern, Callback callback)
|
|||
|
||||
size_t start = length - 6;
|
||||
|
||||
static constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
for (int attempt = 0; attempt < 100; ++attempt) {
|
||||
for (int i = 0; i < 6; ++i)
|
||||
|
|
|
@ -21,7 +21,7 @@ static char* generate_random_filename(const char* pattern)
|
|||
char* new_filename = strdup(pattern);
|
||||
int pattern_length = strlen(pattern);
|
||||
|
||||
static constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
constexpr char random_characters[] = "abcdefghijklmnopqrstuvwxyz0123456789";
|
||||
for (auto i = pattern_length - 1; i >= 0; --i) {
|
||||
if (pattern[i] != 'X')
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue