diff options
author | Hendiadyoin1 <leon.a@serenityos.org> | 2022-10-03 13:08:10 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-03 14:15:46 +0100 |
commit | e0a6ed4bc08d00d418343a0ed4ec93d0535b100f (patch) | |
tree | f8736f8aa5a5602162f7b448df09bfa4a81f72be | |
parent | 8a9d4246f13ff4e4c6030472efb6704cd841e018 (diff) | |
download | serenity-e0a6ed4bc08d00d418343a0ed4ec93d0535b100f.zip |
LibWasm: Use String::join in Printer where apropriate
-rw-r--r-- | Userland/Libraries/LibWasm/Printer/Printer.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/Userland/Libraries/LibWasm/Printer/Printer.cpp b/Userland/Libraries/LibWasm/Printer/Printer.cpp index 7650720047..bef8d3926e 100644 --- a/Userland/Libraries/LibWasm/Printer/Printer.cpp +++ b/Userland/Libraries/LibWasm/Printer/Printer.cpp @@ -131,27 +131,13 @@ void Printer::print(Wasm::DataSection::Data const& data) [this](DataSection::Data::Passive const& value) { print_indent(); print("(passive init {}xu8 (", value.init.size()); - bool first = true; - for (auto v : value.init) { - if (first) - print("{:x}", v); - else - print(" {:x}", v); - first = false; - } + print(String::join(' ', value.init, "{:x}"sv)); print(")\n"); }, [this](DataSection::Data::Active const& value) { print_indent(); print("(active init {}xu8 (", value.init.size()); - bool first = true; - for (auto v : value.init) { - if (first) - print("{:x}", v); - else - print(" {:x}", v); - first = false; - } + print(String::join(' ', value.init, "{:x}"sv)); print("\n"); { TemporaryChange change { m_indent, m_indent + 1 }; |