1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:17:36 +00:00

Meta+Userland: Simplify some formatters

These are mostly minor mistakes I've encountered while working on the
removal of StringView(char const*). The usage of builder.put_string over
Format<FormatString>::format is preferrable as it will avoid the
indirection altogether when there's no formatting to be done. Similarly,
there is no need to do format(builder, "{}", number) when
builder.put_u64(number) works equally well.

Additionally a few Strings where only constant strings were used are
replaced with StringViews.
This commit is contained in:
sin-ack 2022-07-11 20:23:24 +00:00 committed by Andreas Kling
parent 7da00bfa8d
commit 7456904a39
9 changed files with 64 additions and 67 deletions

View file

@ -86,8 +86,7 @@ struct Traits<GUI::PersistentModelIndex> : public GenericTraits<GUI::PersistentM
{
if (index.has_valid_handle())
return Traits<GUI::ModelIndex>::hash(index.m_handle->m_index);
else
return 0;
return 0;
}
};