1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:57:44 +00:00

Everywhere: Add sv suffix to strings relying on StringView(char const*)

Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -321,24 +321,24 @@ Messages::WebContentServer::InspectDomNodeResponse ConnectionFromClient::inspect
auto box_model = box->box_model();
StringBuilder builder;
auto serializer = MUST(JsonObjectSerializer<>::try_create(builder));
MUST(serializer.add("padding_top", box_model.padding.top));
MUST(serializer.add("padding_right", box_model.padding.right));
MUST(serializer.add("padding_bottom", box_model.padding.bottom));
MUST(serializer.add("padding_left", box_model.padding.left));
MUST(serializer.add("margin_top", box_model.margin.top));
MUST(serializer.add("margin_right", box_model.margin.right));
MUST(serializer.add("margin_bottom", box_model.margin.bottom));
MUST(serializer.add("margin_left", box_model.margin.left));
MUST(serializer.add("border_top", box_model.border.top));
MUST(serializer.add("border_right", box_model.border.right));
MUST(serializer.add("border_bottom", box_model.border.bottom));
MUST(serializer.add("border_left", box_model.border.left));
MUST(serializer.add("padding_top"sv, box_model.padding.top));
MUST(serializer.add("padding_right"sv, box_model.padding.right));
MUST(serializer.add("padding_bottom"sv, box_model.padding.bottom));
MUST(serializer.add("padding_left"sv, box_model.padding.left));
MUST(serializer.add("margin_top"sv, box_model.margin.top));
MUST(serializer.add("margin_right"sv, box_model.margin.right));
MUST(serializer.add("margin_bottom"sv, box_model.margin.bottom));
MUST(serializer.add("margin_left"sv, box_model.margin.left));
MUST(serializer.add("border_top"sv, box_model.border.top));
MUST(serializer.add("border_right"sv, box_model.border.right));
MUST(serializer.add("border_bottom"sv, box_model.border.bottom));
MUST(serializer.add("border_left"sv, box_model.border.left));
if (auto* paint_box = box->paint_box()) {
MUST(serializer.add("content_width", paint_box->content_width()));
MUST(serializer.add("content_height", paint_box->content_height()));
MUST(serializer.add("content_width"sv, paint_box->content_width()));
MUST(serializer.add("content_height"sv, paint_box->content_height()));
} else {
MUST(serializer.add("content_width", 0));
MUST(serializer.add("content_height", 0));
MUST(serializer.add("content_width"sv, 0));
MUST(serializer.add("content_height"sv, 0));
}
MUST(serializer.finish());