summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-20 14:40:08 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-20 14:41:23 +0100
commit5db8940c9e6f505208e7cec0543f772ae56979c9 (patch)
tree1f3d623e18809384e8796abce2ffe14507e1a7d1
parent4eef3e5a09f6dcdddb654e05a77831ef27a3a537 (diff)
downloadserenity-5db8940c9e6f505208e7cec0543f772ae56979c9.zip
LibJS: Use StringBuilder::join()
-rw-r--r--Libraries/LibJS/AST.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp
index b9ee359d4a..7edbc26e44 100644
--- a/Libraries/LibJS/AST.cpp
+++ b/Libraries/LibJS/AST.cpp
@@ -393,16 +393,8 @@ void NullLiteral::dump(int indent) const
void FunctionNode::dump(int indent, const char* class_name) const
{
- bool first_time = true;
StringBuilder parameters_builder;
- for (const auto& parameter : parameters()) {
- if (first_time)
- first_time = false;
- else
- parameters_builder.append(',');
-
- parameters_builder.append(parameter);
- }
+ parameters_builder.join(',', parameters());
print_indent(indent);
printf("%s '%s(%s)'\n", class_name, name().characters(), parameters_builder.build().characters());