1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:27:45 +00: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:
sin-ack 2022-07-11 20:10:18 +00:00 committed by Andreas Kling
parent 3f3f45580a
commit c8585b77d2
86 changed files with 283 additions and 283 deletions

View file

@ -303,7 +303,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::store(StoreMethod method, Seque
StringBuilder flags_builder;
flags_builder.append('(');
flags_builder.join(" ", flags);
flags_builder.join(' ', flags);
flags_builder.append(')');
auto command = Command { uid ? CommandType::UIDStore : CommandType::Store, m_current_command, { sequence_set.serialize(), data_item_name.build(), flags_builder.build() } };
@ -361,7 +361,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::status(StringView mailbox, Vect
}
StringBuilder types_list;
types_list.append('(');
types_list.join(" ", args);
types_list.join(' ', args);
types_list.append(')');
auto command = Command { CommandType::Status, m_current_command, { mailbox, types_list.build() } };
return cast_promise<SolidResponse>(send_command(move(command)));
@ -373,7 +373,7 @@ RefPtr<Promise<Optional<SolidResponse>>> Client::append(StringView mailbox, Mess
if (flags.has_value()) {
StringBuilder flags_sb;
flags_sb.append('(');
flags_sb.join(" ", flags.value());
flags_sb.join(' ', flags.value());
flags_sb.append(')');
args.append(flags_sb.build());
}

View file

@ -36,11 +36,11 @@ String FetchCommand::DataItem::Section::serialize() const
bool first = true;
for (auto& field : headers.value()) {
if (!first)
headers_builder.append(" ");
headers_builder.append(' ');
headers_builder.append(field);
first = false;
}
headers_builder.append(")");
headers_builder.append(')');
return headers_builder.build();
}
case SectionType::Text:
@ -50,7 +50,7 @@ String FetchCommand::DataItem::Section::serialize() const
bool first = true;
for (int part : parts.value()) {
if (!first)
sb.append(".");
sb.append('.');
sb.appendff("{}", part);
first = false;
}
@ -95,7 +95,7 @@ String FetchCommand::serialize()
bool first = true;
for (auto& sequence : sequence_set) {
if (!first) {
sequence_builder.append(",");
sequence_builder.append(',');
}
sequence_builder.append(sequence.serialize());
first = false;
@ -105,7 +105,7 @@ String FetchCommand::serialize()
first = true;
for (auto& data_item : data_items) {
if (!first) {
data_items_builder.append(" ");
data_items_builder.append(' ');
}
data_items_builder.append(data_item.serialize());
first = false;
@ -156,7 +156,7 @@ String SearchKey::serialize() const
[&](Recent const&) { return String("RECENT"); },
[&](SearchKeys const& x) {
StringBuilder sb;
sb.append("(");
sb.append('(');
bool first = true;
for (const auto& item : x.keys) {
if (!first)