From f3a07193e57bbf6782ee5181c325b99fb086ec33 Mon Sep 17 00:00:00 2001 From: Roland1975 Date: Fri, 26 Jul 2013 13:33:34 +0200 Subject: [PATCH] refactor to reflect logic on line 62 --- .../angularjs-perf/js/controllers/todoCtrl.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/architecture-examples/angularjs-perf/js/controllers/todoCtrl.js b/architecture-examples/angularjs-perf/js/controllers/todoCtrl.js index df1da019e6..4285615cf8 100644 --- a/architecture-examples/angularjs-perf/js/controllers/todoCtrl.js +++ b/architecture-examples/angularjs-perf/js/controllers/todoCtrl.js @@ -65,11 +65,7 @@ todomvc.controller('TodoCtrl', function TodoCtrl($scope, $location, todoStorage, }; $scope.todoCompleted = function (todo) { - if (todo.completed) { - $scope.remainingCount--; - } else { - $scope.remainingCount++; - } + $scope.remainingCount += todo.completed ? -1 : 1; todoStorage.put(todos); };