mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-30 21:28:59 +00:00
LibELF: Use member initialization for AuxiliaryVector::optional_string
When the member is initialized in the constructor body, but also has a default constructor, you pay for default construction to just throw it away. In this case a StringView is light weight to initialize, but we might as well fix all cases we find. Found by PVS-Studio: https://pvs-studio.com/en/docs/warnings/v818/
This commit is contained in:
parent
7b2506c054
commit
d347432a9e
Notes:
sideshowbarker
2024-07-18 02:51:44 +09:00
Author: https://github.com/bgianfo
Commit: d347432a9e
Pull-request: https://github.com/SerenityOS/serenity/pull/10418
1 changed files with 1 additions and 1 deletions
|
@ -90,10 +90,10 @@ struct AuxiliaryValue {
|
|||
auxv.a_un.a_ptr = (void*)ptr;
|
||||
}
|
||||
AuxiliaryValue(Type type, StringView string)
|
||||
: optional_string(string)
|
||||
{
|
||||
auxv.a_type = type;
|
||||
auxv.a_un.a_ptr = nullptr;
|
||||
optional_string = string;
|
||||
}
|
||||
|
||||
auxv_t auxv {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue