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/Libraries/LibCpp | |
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/Libraries/LibCpp')
-rw-r--r-- | Userland/Libraries/LibCpp/AST.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp index 19f2b60cca..cc19ce59c9 100644 --- a/Userland/Libraries/LibCpp/AST.cpp +++ b/Userland/Libraries/LibCpp/AST.cpp @@ -35,7 +35,7 @@ void FunctionDeclaration::dump(FILE* output, size_t indent) const String qualifiers_string; if (!m_qualifiers.is_empty()) { print_indent(output, indent + 1); - outln(output, "[{}]", String::join(" ", m_qualifiers)); + outln(output, "[{}]", String::join(' ', m_qualifiers)); } m_return_type->dump(output, indent + 1); @@ -79,7 +79,7 @@ String NamedType::to_string() const { String qualifiers_string; if (!qualifiers().is_empty()) - qualifiers_string = String::formatted("[{}] ", String::join(" ", qualifiers())); + qualifiers_string = String::formatted("[{}] ", String::join(' ', qualifiers())); String name; if (is_auto()) @@ -96,7 +96,7 @@ String Pointer::to_string() const return {}; StringBuilder builder; builder.append(m_pointee->to_string()); - builder.append("*"); + builder.append('*'); return builder.to_string(); } @@ -107,7 +107,7 @@ String Reference::to_string() const StringBuilder builder; builder.append(m_referenced_type->to_string()); if (m_kind == Kind::Lvalue) - builder.append("&"); + builder.append('&'); else builder.append("&&"sv); return builder.to_string(); @@ -117,7 +117,7 @@ String FunctionType::to_string() const { StringBuilder builder; builder.append(m_return_type->to_string()); - builder.append("("); + builder.append('('); bool first = true; for (auto& parameter : m_parameters) { if (first) @@ -127,11 +127,11 @@ String FunctionType::to_string() const if (parameter.type()) builder.append(parameter.type()->to_string()); if (parameter.name() && !parameter.full_name().is_empty()) { - builder.append(" "); + builder.append(' '); builder.append(parameter.full_name()); } } - builder.append(")"); + builder.append(')'); return builder.to_string(); } |