From 5db8940c9e6f505208e7cec0543f772ae56979c9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 20 Mar 2020 14:40:08 +0100 Subject: LibJS: Use StringBuilder::join() --- Libraries/LibJS/AST.cpp | 10 +--------- 1 file changed, 1 insertion(+), 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()); -- cgit v1.2.3