mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
Everywhere: Replace single-char StringView op. arguments with chars
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 09:27:00 +09:00
Author: https://github.com/sin-ack Commit: https://github.com/SerenityOS/serenity/commit/c8585b77d2 Pull-request: https://github.com/SerenityOS/serenity/pull/14555 Reviewed-by: https://github.com/Dexesttp ✅ Reviewed-by: https://github.com/kleinesfilmroellchen
@@ -79,7 +79,7 @@ public:
|
||||
indent(builder, indentation);
|
||||
builder.append(m_text);
|
||||
}
|
||||
builder.append("\n");
|
||||
builder.append('\n');
|
||||
}
|
||||
virtual ~Comment() override = default;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
builder.appendff("{}: ", m_key);
|
||||
m_value->format(builder, indentation, true);
|
||||
if (!is_inline)
|
||||
builder.append("\n");
|
||||
builder.append('\n');
|
||||
}
|
||||
|
||||
String key() const { return m_key; }
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
if (is_array()) {
|
||||
// custom array serialization as AK's doesn't pretty-print
|
||||
// objects and arrays (we only care about arrays (for now))
|
||||
builder.append("[");
|
||||
builder.append('[');
|
||||
auto first = true;
|
||||
as_array().for_each([&](auto& value) {
|
||||
if (!first)
|
||||
@@ -140,12 +140,12 @@ public:
|
||||
first = false;
|
||||
value.serialize(builder);
|
||||
});
|
||||
builder.append("]");
|
||||
builder.append(']');
|
||||
} else {
|
||||
serialize(builder);
|
||||
}
|
||||
if (!is_inline)
|
||||
builder.append("\n");
|
||||
builder.append('\n');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user