aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai.bazon@gmail.com>2016-04-08 00:32:14 +0300
committerMihai Bazon <mihai.bazon@gmail.com>2016-04-08 00:32:14 +0300
commitb434b75b3676f5e3f42bf3817ac7dc1ab898b3d2 (patch)
tree1bb67645516174c12cd415eb41ef09853042dbb4
parent931723737204d0a042604f8051ca3af8aa08a1c7 (diff)
parentc70d176f359c5640d3eb64a639958bec5fe45f7e (diff)
downloadtracifyjs-b434b75b3676f5e3f42bf3817ac7dc1ab898b3d2.tar.gz
tracifyjs-b434b75b3676f5e3f42bf3817ac7dc1ab898b3d2.zip
Merge pull request #1032 from kzc/member
Simplify member(name, array) implementation.
-rw-r--r--lib/utils.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/utils.js b/lib/utils.js
index c81ca71f..78c6dbf7 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -59,10 +59,7 @@ function characters(str) {
};
function member(name, array) {
- for (var i = array.length; --i >= 0;)
- if (array[i] == name)
- return true;
- return false;
+ return array.indexOf(name) >= 0;
};
function find_if(func, array) {