mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:27:35 +00:00
Everywhere: Pass AK::Format TypeErasedFormatParams by reference
This silences a overeager warning in sonar cloud, warning that slicing could occur with `VariadicFormatParams` which derives from `TypeErasedFormatParams`. Reference: https://sonarcloud.io/project/issues?id=SerenityOS_serenity&issues=AXuVPBO_k92xXUF3qWsm&open=AXuVPBO_k92xXUF3qWsm
This commit is contained in:
parent
11832544e5
commit
f0b3aa0331
5 changed files with 39 additions and 23 deletions
|
@ -13,8 +13,10 @@ extern bool g_report_to_debug;
|
|||
template<typename... Ts>
|
||||
void reportln(const StringView& format, Ts... args)
|
||||
{
|
||||
if (g_report_to_debug)
|
||||
AK::vdbgln(format, AK::VariadicFormatParams { args... });
|
||||
else
|
||||
if (g_report_to_debug) {
|
||||
AK::VariadicFormatParams variadic_format_params { args... };
|
||||
AK::vdbgln(format, variadic_format_params);
|
||||
} else {
|
||||
warnln(format, args...);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue