mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:57:46 +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:
parent
3f3f45580a
commit
c8585b77d2
86 changed files with 283 additions and 283 deletions
|
@ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (definition.value.parameters.is_empty())
|
||||
outln("{}: {}", definition.key, definition.value.value);
|
||||
else
|
||||
outln("{}({}): {}", definition.key, String::join(",", definition.value.parameters), definition.value.value);
|
||||
outln("{}({}): {}", definition.key, String::join(',', definition.value.parameters), definition.value.value);
|
||||
}
|
||||
outln("");
|
||||
}
|
||||
|
|
|
@ -41,11 +41,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
// Action
|
||||
if (num_added > 0 && num_removed > 0)
|
||||
sb.append("c");
|
||||
sb.append('c');
|
||||
else if (num_added > 0)
|
||||
sb.append("a");
|
||||
sb.append('a');
|
||||
else
|
||||
sb.append("d");
|
||||
sb.append('d');
|
||||
|
||||
// Target line(s)
|
||||
sb.appendff("{}", target_start);
|
||||
|
|
|
@ -1449,7 +1449,7 @@ public:
|
|||
return JS::js_undefined();
|
||||
}
|
||||
|
||||
auto output = String::join(" ", arguments.get<JS::MarkedVector<JS::Value>>());
|
||||
auto output = String::join(' ', arguments.get<JS::MarkedVector<JS::Value>>());
|
||||
m_console.output_debug_message(log_level, output);
|
||||
|
||||
switch (log_level) {
|
||||
|
|
|
@ -54,7 +54,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
}
|
||||
StringBuilder path_builder;
|
||||
if (lexical_path.is_absolute())
|
||||
path_builder.append("/");
|
||||
path_builder.append('/');
|
||||
|
||||
auto& parts = lexical_path.parts_view();
|
||||
size_t num_parts = parts.size();
|
||||
|
@ -88,7 +88,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
break;
|
||||
}
|
||||
}
|
||||
path_builder.append("/");
|
||||
path_builder.append('/');
|
||||
}
|
||||
}
|
||||
return has_errors ? 1 : 0;
|
||||
|
|
|
@ -70,7 +70,7 @@ static int get_source_fd(StringView source)
|
|||
static bool mount_by_line(String const& line)
|
||||
{
|
||||
// Skip comments and blank lines.
|
||||
if (line.is_empty() || line.starts_with("#"))
|
||||
if (line.is_empty() || line.starts_with('#'))
|
||||
return true;
|
||||
|
||||
Vector<String> parts = line.split('\t');
|
||||
|
|
|
@ -205,7 +205,7 @@ void print_human_readable(termios const& modes, winsize const& ws, bool verbose_
|
|||
auto escape_character = [&](u8 ch) {
|
||||
StringBuilder sb;
|
||||
if (ch <= 0x20) {
|
||||
sb.append("^");
|
||||
sb.append('^');
|
||||
sb.append(ch + 0x40);
|
||||
} else if (ch == 0x7f) {
|
||||
sb.append("^?"sv);
|
||||
|
|
|
@ -93,7 +93,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (line.is_empty())
|
||||
continue;
|
||||
|
||||
if (line.starts_with(".")) {
|
||||
if (line.starts_with('.')) {
|
||||
if (line.starts_with(".text "sv)) {
|
||||
editor->add_to_history(line);
|
||||
if (socket->ready_state() != Protocol::WebSocket::ReadyState::Open) {
|
||||
|
|
|
@ -197,7 +197,7 @@ bool run_command(Vector<char*>&& child_argv, bool verbose, bool is_stdin, int de
|
|||
|
||||
if (verbose) {
|
||||
StringBuilder builder;
|
||||
builder.join(" ", child_argv);
|
||||
builder.join(' ', child_argv);
|
||||
warnln("xargs: {}", builder.to_string());
|
||||
}
|
||||
|
||||
|
|
|
@ -424,10 +424,10 @@ static void do_run_tests(XML::Document& document)
|
|||
|
||||
StringBuilder path_builder;
|
||||
path_builder.append(base_path);
|
||||
path_builder.append("/");
|
||||
path_builder.append('/');
|
||||
for (auto& entry : bases.in_reverse()) {
|
||||
path_builder.append(entry);
|
||||
path_builder.append("/");
|
||||
path_builder.append('/');
|
||||
}
|
||||
auto test_base_path = path_builder.to_string();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue