Skip to content

Commit 33812ac

Browse files
Merge pull request #1868 from akre54/uniq-contains
use _.contains in _.uniq instead of indexOf
2 parents 5b4286e + f1545a3 commit 33812ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

underscore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,11 @@
513513
if (!i || seen !== computed) result.push(value);
514514
seen = computed;
515515
} else if (iteratee) {
516-
if (_.indexOf(seen, computed) < 0) {
516+
if (!_.contains(seen, computed)) {
517517
seen.push(computed);
518518
result.push(value);
519519
}
520-
} else if (_.indexOf(result, value) < 0) {
520+
} else if (!_.contains(result, value)) {
521521
result.push(value);
522522
}
523523
}

0 commit comments

Comments
 (0)