diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 17:32:29 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | 3f3f45580ab7266258e97cb3cecf1e24716d61c5 (patch) | |
tree | 152c7a187c98184d58bf91a326357e0af435edcf /Userland/Libraries/LibPDF/Parser.cpp | |
parent | e5f09ea1703bacfbb79a4ad3c587a7d5d3d7bb13 (diff) | |
download | serenity-3f3f45580ab7266258e97cb3cecf1e24716d61c5.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibPDF/Parser.cpp')
-rw-r--r-- | Userland/Libraries/LibPDF/Parser.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibPDF/Parser.cpp b/Userland/Libraries/LibPDF/Parser.cpp index 81988d3191..58e412f86b 100644 --- a/Userland/Libraries/LibPDF/Parser.cpp +++ b/Userland/Libraries/LibPDF/Parser.cpp @@ -1155,7 +1155,7 @@ struct Formatter<PDF::Parser::LinearizationDictionary> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::LinearizationDictionary const& dict) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" length_of_file={}\n", dict.length_of_file); builder.appendff(" primary_hint_stream_offset={}\n", dict.primary_hint_stream_offset); builder.appendff(" primary_hint_stream_length={}\n", dict.primary_hint_stream_length); @@ -1176,7 +1176,7 @@ struct Formatter<PDF::Parser::PageOffsetHintTable> : Formatter<StringView> { ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::PageOffsetHintTable const& table) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" least_number_of_objects_in_a_page={}\n", table.least_number_of_objects_in_a_page); builder.appendff(" location_of_first_page_object={}\n", table.location_of_first_page_object); builder.appendff(" bits_required_for_object_number={}\n", table.bits_required_for_object_number); @@ -1200,18 +1200,18 @@ struct Formatter<PDF::Parser::PageOffsetHintTableEntry> : Formatter<StringView> ErrorOr<void> format(FormatBuilder& format_builder, PDF::Parser::PageOffsetHintTableEntry const& entry) { StringBuilder builder; - builder.append("{\n"); + builder.append("{\n"sv); builder.appendff(" objects_in_page_number={}\n", entry.objects_in_page_number); builder.appendff(" page_length_number={}\n", entry.page_length_number); builder.appendff(" number_of_shared_objects={}\n", entry.number_of_shared_objects); - builder.append(" shared_object_identifiers=["); + builder.append(" shared_object_identifiers=["sv); for (auto& identifier : entry.shared_object_identifiers) builder.appendff(" {}", identifier); - builder.append(" ]\n"); - builder.append(" shared_object_location_numerators=["); + builder.append(" ]\n"sv); + builder.append(" shared_object_location_numerators=["sv); for (auto& numerator : entry.shared_object_location_numerators) builder.appendff(" {}", numerator); - builder.append(" ]\n"); + builder.append(" ]\n"sv); builder.appendff(" page_content_stream_offset_number={}\n", entry.page_content_stream_offset_number); builder.appendff(" page_content_stream_length_number={}\n", entry.page_content_stream_length_number); builder.append('}'); |