diff options
Diffstat (limited to 'src/ir/module-utils.cpp')
-rw-r--r-- | src/ir/module-utils.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index 8e6ac0d1a..f7ba7d776 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -317,11 +317,10 @@ std::vector<HeapType> getPublicHeapTypes(Module& wasm) { } std::vector<HeapType> getPrivateHeapTypes(Module& wasm) { - auto allTypes = getHeapTypeCounts(wasm, true); + auto usedTypes = getHeapTypeCounts(wasm, true); auto publicTypes = getPublicTypeSet(wasm); std::vector<HeapType> types; - types.reserve(allTypes.size() - publicTypes.size()); - for (auto& [type, _] : allTypes) { + for (auto& [type, _] : usedTypes) { if (!publicTypes.count(type)) { types.push_back(type); } |