diff options
author | Lenny Maiorani <lenny@colorado.edu> | 2021-05-19 08:35:09 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-19 21:21:47 +0100 |
commit | 57513271956942bbe51b39afeb4bb445aaff21fb (patch) | |
tree | 38fb1fc2a13b8f8d7538a214195bee6936d2da24 /Kernel/Net/NetworkTask.cpp | |
parent | 2b64d163cd9f25bd2951bf8721ef9325decb1b72 (diff) | |
download | serenity-57513271956942bbe51b39afeb4bb445aaff21fb.zip |
Kernel: static vs non-static constexpr variables
Problem:
- `static` variables consume memory and sometimes are less
optimizable.
- `static const` variables can be `constexpr`, usually.
- `static` function-local variables require an initialization check
every time the function is run.
Solution:
- If a global `static` variable is only used in a single function then
move it into the function and make it non-`static` and `constexpr`.
- Make all global `static` variables `constexpr` instead of `const`.
- Change function-local `static const[expr]` variables to be just
`constexpr`.
Diffstat (limited to 'Kernel/Net/NetworkTask.cpp')
0 files changed, 0 insertions, 0 deletions