From 9914f62c4d619a5d62254fed5cabb7c7debeb560 Mon Sep 17 00:00:00 2001 From: Manos Koukoutos Date: Fri, 6 Nov 2020 08:29:37 +0000 Subject: [PATCH] [wasm] Simplify function name decoding in module-decoder.cc Change-Id: I66043e0e251ad3214a0d695434c2850caac96c69 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2521145 Reviewed-by: Andreas Haas Commit-Queue: Manos Koukoutos Cr-Commit-Position: refs/heads/master@{#71049} --- src/wasm/module-decoder.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/wasm/module-decoder.cc b/src/wasm/module-decoder.cc index 112d510da0..d28405a6d6 100644 --- a/src/wasm/module-decoder.cc +++ b/src/wasm/module-decoder.cc @@ -2448,14 +2448,8 @@ void DecodeFunctionNames(const byte* module_start, const byte* module_end, // Extract from export table. for (const WasmExport& exp : export_table) { - switch (exp.kind) { - case kExternalFunction: - if (names->count(exp.index) == 0) { - names->insert(std::make_pair(exp.index, exp.name)); - } - break; - default: - break; + if (exp.kind == kExternalFunction && names->count(exp.index) == 0) { + names->insert(std::make_pair(exp.index, exp.name)); } } }