From d7310ac80749a685a16c2f670ea49a829881c6db 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 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/wasm/wasm-ir-builder.cpp b/src/wasm/wasm-ir-builder.cpp index 6676d1cb473..1df441dad39 100644 --- a/src/wasm/wasm-ir-builder.cpp +++ b/src/wasm/wasm-ir-builder.cpp @@ -416,19 +416,7 @@ 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 numValues == 0 ? nullptr : pop(numValues); } Result<> IRBuilder::visitBreak(Break* curr, std::optional label) {