1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

LibJS: Use builder.join in to_string_impl()s where applicable

This commit is contained in:
Hendiadyoin1 2022-08-31 14:18:27 +02:00 committed by Linus Groh
parent 4370e8f80a
commit 25be67299e

View file

@ -890,11 +890,7 @@ String CopyObjectExcludingProperties::to_string_impl(Bytecode::Executable const&
builder.appendff("CopyObjectExcludingProperties from:{}", m_from_object); builder.appendff("CopyObjectExcludingProperties from:{}", m_from_object);
if (m_excluded_names_count != 0) { if (m_excluded_names_count != 0) {
builder.append(" excluding:["sv); builder.append(" excluding:["sv);
for (size_t i = 0; i < m_excluded_names_count; ++i) { builder.join(", "sv, Span<Register const>(m_excluded_names, m_excluded_names_count));
builder.appendff("{}", m_excluded_names[i]);
if (i != m_excluded_names_count - 1)
builder.append(',');
}
builder.append(']'); builder.append(']');
} }
return builder.to_string(); return builder.to_string();
@ -998,11 +994,7 @@ String Call::to_string_impl(Bytecode::Executable const&) const
builder.appendff("Call callee:{}, this:{}", m_callee, m_this_value); builder.appendff("Call callee:{}, this:{}", m_callee, m_this_value);
if (m_argument_count != 0) { if (m_argument_count != 0) {
builder.append(", arguments:["sv); builder.append(", arguments:["sv);
for (size_t i = 0; i < m_argument_count; ++i) { builder.join(", "sv, Span<Register const>(m_arguments, m_argument_count));
builder.appendff("{}", m_arguments[i]);
if (i != m_argument_count - 1)
builder.append(',');
}
builder.append(']'); builder.append(']');
} }
return builder.to_string(); return builder.to_string();