mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02: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:
Notes:
sideshowbarker
2024-07-17 09:27:58 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/7456904a39 Pull-request: https://github.com/SerenityOS/serenity/pull/14555 Reviewed-by: https://github.com/Dexesttp ✅ Reviewed-by: https://github.com/kleinesfilmroellchen
@@ -375,7 +375,7 @@ bool UnsignedBigInteger::operator>=(UnsignedBigInteger const& other) const
|
||||
ErrorOr<void> AK::Formatter<Crypto::UnsignedBigInteger>::format(FormatBuilder& fmtbuilder, Crypto::UnsignedBigInteger const& value)
|
||||
{
|
||||
if (value.is_invalid())
|
||||
return Formatter<StringView>::format(fmtbuilder, "invalid");
|
||||
return fmtbuilder.put_string("invalid"sv);
|
||||
|
||||
StringBuilder builder;
|
||||
for (int i = value.length() - 1; i >= 0; --i)
|
||||
|
||||
Reference in New Issue
Block a user