From 303f9524df6fc856d39a9181dad5d1fa95686fa3 Mon Sep 17 00:00:00 2001 From: Ashley Nelson Date: Fri, 23 Feb 2024 00:43:16 +0000 Subject: [PATCH] use pop more --- src/wasm/wasm-ir-builder.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index 6676d1cb473..957168a8dce 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -416,18 +416,10 @@ Result IRBuilder::getBranchValue(Name labelName, // Loops would receive their input type rather than their output type, if we // supported that. size_t numValues = (*scope)->getLoop() ? 0 : (*scope)->getResultType().size(); - std::vector values(numValues); - for (size_t i = 0; i < numValues; ++i) { - auto val = pop(); - CHECK_ERR(val); - values[numValues - 1 - i] = *val; - } if (numValues == 0) { return nullptr; - } else if (numValues == 1) { - return values[0]; } else { - return builder.makeTupleMake(values); + return pop(numValues); } }