summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2020-08-20 01:36:17 +0200
committerGitHub <noreply@github.com>2020-08-19 16:36:17 -0700
commita18d30fb42838f2e4002338d6e57a25322f9e422 (patch)
tree930607d9202d35eaf66d784df29162400efd98cb /src/wasm/wasm-s-parser.cpp
parentb43807a835fc878e5eefcb8b4a18aff62d7f4540 (diff)
downloadbinaryen-a18d30fb42838f2e4002338d6e57a25322f9e422.tar.gz
binaryen-a18d30fb42838f2e4002338d6e57a25322f9e422.tar.bz2
binaryen-a18d30fb42838f2e4002338d6e57a25322f9e422.zip
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.
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r--src/wasm/wasm-s-parser.cpp6
1 files changed, 3 insertions, 3 deletions
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<Type>& 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);
}
}