Bladeren bron

Remove method Iterator.prototype.iterate and use Array.prototype.forEach on items property instead

Axel Duch 9 jaren geleden
bovenliggende
commit
4cdf6f2fde
1 gewijzigde bestanden met toevoegingen van 1 en 6 verwijderingen
  1. 1 6
      src/common/Iterator.js

+ 1 - 6
src/common/Iterator.js

@@ -3,17 +3,12 @@ function Iterator(items) {
 }
 }
 
 
 
 
-Iterator.prototype.iterate = function(callback) {
-    this.items.forEach(callback);
-};
-
-
 /* Calls a method on every item passing the arguments through */
 /* Calls a method on every item passing the arguments through */
 Iterator.prototype.proxyCall = function(methodName) {
 Iterator.prototype.proxyCall = function(methodName) {
     var args = Array.prototype.slice.call(arguments, 1);
     var args = Array.prototype.slice.call(arguments, 1);
     var results = [];
     var results = [];
 
 
-    this.iterate(function(item) {
+    this.items.forEach(function(item) {
         results.push(item[methodName].apply(item, args));
         results.push(item[methodName].apply(item, args));
     });
     });