diff options
author | Mihai Bazon <mihai.bazon@gmail.com> | 2016-04-08 00:32:14 +0300 |
---|---|---|
committer | Mihai Bazon <mihai.bazon@gmail.com> | 2016-04-08 00:32:14 +0300 |
commit | b434b75b3676f5e3f42bf3817ac7dc1ab898b3d2 (patch) | |
tree | 1bb67645516174c12cd415eb41ef09853042dbb4 | |
parent | 931723737204d0a042604f8051ca3af8aa08a1c7 (diff) | |
parent | c70d176f359c5640d3eb64a639958bec5fe45f7e (diff) | |
download | tracifyjs-b434b75b3676f5e3f42bf3817ac7dc1ab898b3d2.tar.gz tracifyjs-b434b75b3676f5e3f42bf3817ac7dc1ab898b3d2.zip |
Merge pull request #1032 from kzc/member
Simplify member(name, array) implementation.
-rw-r--r-- | lib/utils.js | 5 |
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) { |