diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 20:10:18 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | c8585b77d263d15807231cb8bd1345d2591b9495 (patch) | |
tree | ac3c44a6f7d6fad59b942809d67b92826386b25c /Userland/Shell/AST.cpp | |
parent | 3f3f45580ab7266258e97cb3cecf1e24716d61c5 (diff) | |
download | serenity-c8585b77d263d15807231cb8bd1345d2591b9495.zip |
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.
Diffstat (limited to 'Userland/Shell/AST.cpp')
-rw-r--r-- | Userland/Shell/AST.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index 56012ed9d1..c6bf44137c 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -2665,7 +2665,7 @@ RefPtr<Value> ReadRedirection::run(RefPtr<Shell> shell) return make_ref_counted<ListValue>({}); StringBuilder builder; - builder.join(" ", path_segments); + builder.join(' ', path_segments); command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Read)); return make_ref_counted<CommandValue>(move(command)); @@ -2695,7 +2695,7 @@ RefPtr<Value> ReadWriteRedirection::run(RefPtr<Shell> shell) return make_ref_counted<ListValue>({}); StringBuilder builder; - builder.join(" ", path_segments); + builder.join(' ', path_segments); command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::ReadWrite)); return make_ref_counted<CommandValue>(move(command)); @@ -3052,7 +3052,7 @@ void Juxtaposition::highlight_in_editor(Line::Editor& editor, Shell& shell, High StringBuilder path_builder; path_builder.append(tilde_value); - path_builder.append("/"); + path_builder.append('/'); path_builder.append(bareword_value); auto path = path_builder.to_string(); @@ -3183,8 +3183,8 @@ RefPtr<Value> StringPartCompose::run(RefPtr<Shell> shell) return make_ref_counted<ListValue>({}); StringBuilder builder; - builder.join(" ", left); - builder.join(" ", right); + builder.join(' ', left); + builder.join(' ', right); return make_ref_counted<StringValue>(builder.to_string()); } @@ -3347,7 +3347,7 @@ RefPtr<Value> WriteAppendRedirection::run(RefPtr<Shell> shell) return make_ref_counted<ListValue>({}); StringBuilder builder; - builder.join(" ", path_segments); + builder.join(' ', path_segments); command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::WriteAppend)); return make_ref_counted<CommandValue>(move(command)); @@ -3377,7 +3377,7 @@ RefPtr<Value> WriteRedirection::run(RefPtr<Shell> shell) return make_ref_counted<ListValue>({}); StringBuilder builder; - builder.join(" ", path_segments); + builder.join(' ', path_segments); command.redirections.append(PathRedirection::create(builder.to_string(), m_fd, PathRedirection::Write)); return make_ref_counted<CommandValue>(move(command)); @@ -3724,7 +3724,7 @@ String TildeValue::resolve_as_string(RefPtr<Shell> shell) Vector<String> TildeValue::resolve_as_list(RefPtr<Shell> shell) { StringBuilder builder; - builder.append("~"); + builder.append('~'); builder.append(m_username); if (!shell) |