1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:17:44 +00:00

AK: Remove StringBuilder::build() in favor of to_deprecated_string()

Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
This commit is contained in:
Linus Groh 2023-01-26 18:58:09 +00:00
parent da81041e97
commit 6e7459322d
129 changed files with 213 additions and 219 deletions

View file

@ -229,7 +229,7 @@ DeprecatedString DOMTokenList::value() const
{
StringBuilder builder;
builder.join(' ', m_token_set);
return builder.build();
return builder.to_deprecated_string();
}
// https://dom.spec.whatwg.org/#ref-for-concept-element-attributes-set-value%E2%91%A2

View file

@ -386,7 +386,7 @@ WebIDL::ExceptionOr<void> Document::write(Vector<DeprecatedString> const& string
StringBuilder builder;
builder.join(""sv, strings);
return run_the_document_write_steps(builder.build());
return run_the_document_write_steps(builder.to_deprecated_string());
}
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln
@ -396,7 +396,7 @@ WebIDL::ExceptionOr<void> Document::writeln(Vector<DeprecatedString> const& stri
builder.join(""sv, strings);
builder.append("\n"sv);
return run_the_document_write_steps(builder.build());
return run_the_document_write_steps(builder.to_deprecated_string());
}
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-write-steps

View file

@ -270,7 +270,7 @@ DeprecatedString Node::child_text_content() const
if (is<Text>(child))
builder.append(verify_cast<Text>(child).text_content());
});
return builder.build();
return builder.to_deprecated_string();
}
// https://dom.spec.whatwg.org/#concept-tree-root

View file

@ -147,7 +147,7 @@ ErrorOr<Optional<Vector<DeprecatedString>>> get_decode_and_split_header_value(Re
}
// 3. Remove all HTTP tab or space from the start and end of temporaryValue.
auto temporary_value = temporary_value_builder.build().trim(HTTP_TAB_OR_SPACE, TrimMode::Both);
auto temporary_value = temporary_value_builder.to_deprecated_string().trim(HTTP_TAB_OR_SPACE, TrimMode::Both);
// 4. Append temporaryValue to values.
values.append(move(temporary_value));

View file

@ -420,7 +420,7 @@ CanvasRenderingContext2D::PreparedText CanvasRenderingContext2D::prepare_text(De
for (auto c : text) {
builder.append(Infra::is_ascii_whitespace(c) ? ' ' : c);
}
DeprecatedString replaced_text = builder.build();
auto replaced_text = builder.to_deprecated_string();
// 3. Let font be the current font of target, as given by that object's font attribute.
// FIXME: Once we have CanvasTextDrawingStyles, implement font selection.

View file

@ -2816,7 +2816,7 @@ void HTMLTokenizer::insert_input_at_insertion_point(DeprecatedString const& inpu
builder.append(m_decoded_input.substring(0, m_insertion_point.position));
builder.append(input);
builder.append(m_decoded_input.substring(m_insertion_point.position));
m_decoded_input = builder.build();
m_decoded_input = builder.to_deprecated_string();
m_utf8_view = Utf8View(m_decoded_input);
m_utf8_iterator = m_utf8_view.iterator_at_byte_offset(utf8_iterator_byte_offset);

View file

@ -284,7 +284,7 @@ JS::ThrowCompletionOr<size_t> WebAssemblyObject::instantiate_module(JS::VM& vm,
StringBuilder builder;
builder.append("LinkError: Missing "sv);
builder.join(' ', link_result.error().missing_imports);
return vm.throw_completion<JS::TypeError>(builder.build());
return vm.throw_completion<JS::TypeError>(builder.to_deprecated_string());
}
auto instance_result = s_abstract_machine.instantiate(module, link_result.release_value());