1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 13:35:09 +00:00

AK+Kernel: Format DistinctNumeric using the underlying type's formatter

Forcing the formatting to go through `Formatter<FormatString>` is
completely unnecessary, increases code size, performs a String
allocation and prevents us from using the formatting options available
on that type.

This commit also removes explicit formatters from
`BlockBasedFileSystem::BlockIndex` and `Kernel::InodeIndex`, as those
are already covered by the blanket implementation for all
`DistinctNumeric` types.
This commit is contained in:
Daniel Bertalan 2021-09-04 21:28:45 +02:00 committed by Andreas Kling
parent 9bf6d51aec
commit 018c4e0e7e
3 changed files with 2 additions and 18 deletions

View file

@ -48,11 +48,3 @@ private:
};
}
template<>
struct AK::Formatter<Kernel::BlockBasedFileSystem::BlockIndex> : AK::Formatter<FormatString> {
void format(FormatBuilder& builder, Kernel::BlockBasedFileSystem::BlockIndex value)
{
return AK::Formatter<FormatString>::format(builder, "{}", value.value());
}
};