From ff3b3b086c8516a078d6eec0aba428e288f67575 Mon Sep 17 00:00:00 2001 From: Chhatoi Pritam Baral Date: Mon, 14 Dec 2015 22:53:36 +0530 Subject: [PATCH] Fix minor code smells, thanks jshint! --- src/angular-multi-select.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/angular-multi-select.js b/src/angular-multi-select.js index 9149715..4d81eb5 100644 --- a/src/angular-multi-select.js +++ b/src/angular-multi-select.js @@ -319,10 +319,9 @@ angular_multi_select.directive('angularMultiSelect', (function () { var dupes = {}; + var fn = (function(d, o, n) { return fn(o, n, d); }).bind(this, dupes); for(_idx in obj[key]) { - var new_obj = $scope._walk(obj[key][_idx], key, (function(d, o, n) { - return fn(o, n, d); - }).bind(this, dupes)); + var new_obj = $scope._walk(obj[key][_idx], key, fn); if (new_obj !== null) { sub.push(new_obj); } @@ -783,8 +782,8 @@ angular_multi_select.directive('angularMultiSelect', if (typeof dupes === "undefined") return true; var label = $scope._interpolatedItemLabel(obj); if (dupes[label]) return false; - else return (dupes[label] = true) - } + else return (dupes[label] = true); + }; /** * Returns true if [attrs.searchProperty} matches the search input field (latinized, fuzzy match);