summaryrefslogtreecommitdiff
path: root/src/passes/Asyncify.cpp
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2020-08-20 21:35:14 +0200
committerGitHub <noreply@github.com>2020-08-20 12:35:14 -0700
commitaf87f23744477b034dcb1c59af2a1a208becab23 (patch)
tree1f99d29f17191ecdd121cd15e455cea90b38d303 /src/passes/Asyncify.cpp
parenta18d30fb42838f2e4002338d6e57a25322f9e422 (diff)
downloadbinaryen-af87f23744477b034dcb1c59af2a1a208becab23.tar.gz
binaryen-af87f23744477b034dcb1c59af2a1a208becab23.tar.bz2
binaryen-af87f23744477b034dcb1c59af2a1a208becab23.zip
Use const modifier when dealing with types (#3064)
Since they make the code clearer and more self-documenting.
Diffstat (limited to 'src/passes/Asyncify.cpp')
-rw-r--r--src/passes/Asyncify.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/Asyncify.cpp b/src/passes/Asyncify.cpp
index 1bbc89435..1524bd6c3 100644
--- a/src/passes/Asyncify.cpp
+++ b/src/passes/Asyncify.cpp
@@ -1306,7 +1306,7 @@ private:
}
auto localType = func->getLocalType(i);
SmallVector<Expression*, 1> loads;
- for (auto& type : localType) {
+ for (const auto& type : localType) {
auto size = type.getByteSize();
assert(size % STACK_ALIGN == 0);
// TODO: higher alignment?
@@ -1350,7 +1350,7 @@ private:
}
auto localType = func->getLocalType(i);
size_t j = 0;
- for (auto& type : localType) {
+ for (const auto& type : localType) {
auto size = type.getByteSize();
Expression* localGet = builder->makeLocalGet(i, localType);
if (localType.size() > 1) {