Skip to content

Commit

Permalink
use reverse order in _.indexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 3, 2015
1 parent 1fa16a0 commit 5b413fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ exports.debounce = function (func, wait) {
*/

exports.indexOf = function (arr, obj) {
for (var i = 0, l = arr.length; i < l; i++) {
var i = arr.length
while (i--) {
if (arr[i] === obj) return i
}
return -1
Expand Down

0 comments on commit 5b413fc

Please sign in to comment.