summaryrefslogtreecommitdiff
path: root/src/ir/local-utils.h
diff options
context:
space:
mode:
authorjuj <jujjyl@gmail.com>2022-04-05 23:01:03 +0300
committerGitHub <noreply@github.com>2022-04-05 13:01:03 -0700
commitcbc7e0455dcef0a7df6e4ab345626b8e69534f7f (patch)
tree99bccfd29c3e8cf1d31d56b1934b566f92b54f74 /src/ir/local-utils.h
parent291698fe1b5512d72186dfc2400bca85dcb507b1 (diff)
downloadbinaryen-cbc7e0455dcef0a7df6e4ab345626b8e69534f7f.tar.gz
binaryen-cbc7e0455dcef0a7df6e4ab345626b8e69534f7f.tar.bz2
binaryen-cbc7e0455dcef0a7df6e4ab345626b8e69534f7f.zip
Avoid a code pattern of vec.resize() followed by std::fill() as suboptimal. Instead do a clear()+resize() (#4580)
Diffstat (limited to 'src/ir/local-utils.h')
-rw-r--r--src/ir/local-utils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir/local-utils.h b/src/ir/local-utils.h
index 73d065e73..ef74a35eb 100644
--- a/src/ir/local-utils.h
+++ b/src/ir/local-utils.h
@@ -31,8 +31,8 @@ struct LocalGetCounter : public PostWalker<LocalGetCounter> {
void analyze(Function* func) { analyze(func, func->body); }
void analyze(Function* func, Expression* ast) {
+ num.clear();
num.resize(func->getNumLocals());
- std::fill(num.begin(), num.end(), 0);
walk(ast);
}