AK: Move StandardFormatter argument into base class initializer

Subclasses of StandardFormatter don't need to use the formatter argument
in their constructor, so move() it into the base class initializer.
This commit is contained in:
Andrew Kaster 2021-10-31 17:13:05 -06:00 committed by Andreas Kling
parent 74e8aa73e5
commit 2c4f7fae1e
Notes: sideshowbarker 2024-07-18 01:07:47 +09:00

View File

@ -294,7 +294,7 @@ template<typename T>
struct Formatter<T, typename EnableIf<IsIntegral<T>>::Type> : StandardFormatter {
Formatter() = default;
explicit Formatter(StandardFormatter formatter)
: StandardFormatter(formatter)
: StandardFormatter(move(formatter))
{
}
@ -305,7 +305,7 @@ template<>
struct Formatter<StringView> : StandardFormatter {
Formatter() = default;
explicit Formatter(StandardFormatter formatter)
: StandardFormatter(formatter)
: StandardFormatter(move(formatter))
{
}
@ -317,7 +317,7 @@ requires(HasFormatter<T>) struct Formatter<Vector<T>> : StandardFormatter {
Formatter() = default;
explicit Formatter(StandardFormatter formatter)
: StandardFormatter(formatter)
: StandardFormatter(move(formatter))
{
}
void format(FormatBuilder& builder, Vector<T> value)