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); };