From 4116731b5a8c24c2926130f25a60894ff1ff2428 Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Mon, 8 May 2017 03:57:56 +0800 Subject: [PATCH] use `[].indexOf()` instead of `switch` --- bin/uglifyjs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bin/uglifyjs b/bin/uglifyjs index 9258c758..3aaa3280 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -375,15 +375,7 @@ function to_cache(key) { return cache[key]; } +var skip_keys = [ "cname", "enclosed", "parent_scope", "scope", "thedef", "uses_eval", "uses_with" ]; function skip_key(key) { - switch (key) { - case "cname": - case "enclosed": - case "parent_scope": - case "scope": - case "thedef": - case "uses_eval": - case "uses_with": - return true; - } + return skip_keys.indexOf(key) >= 0; }