From a18d30fb42838f2e4002338d6e57a25322f9e422 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Thu, 20 Aug 2020 01:36:17 +0200 Subject: Replace Type::expand() with an iterator-based approach (#3061) This leads to simpler code and is a prerequisite for #3012, which makes it so that not all `Type`s are backed by vectors that `expand` could return. --- src/wasm/wasm-s-parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 5e6008bca..15ec266b3 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -640,9 +640,9 @@ SExpressionWasmBuilder::parseTypeUse(Element& s, // If only (type) is specified, populate `namedParams` if (!paramsOrResultsExist) { - const std::vector& funcParams = functionSignature.params.expand(); - for (size_t index = 0, e = funcParams.size(); index < e; index++) { - namedParams.emplace_back(Name::fromInt(index), funcParams[index]); + size_t index = 0; + for (auto& param : functionSignature.params) { + namedParams.emplace_back(Name::fromInt(index++), param); } } -- cgit v1.2.3