dont loop over files twice

This commit is contained in:
j 2012-04-19 14:19:57 +02:00
parent 461cd3d686
commit e765153f9c

View file

@ -177,7 +177,7 @@ Ox.loadFiles = (function() {
return function(files, callback) { return function(files, callback) {
var i = 0, n = files.length, images = {}; var i = 0, n = files.length, images = {};
files.forEach(function(file) { files.forEach(function(file) {
loadFiles(files, function(images_) { loadFiles(file, function(images_) {
Ox.extend(images, images_) Ox.extend(images, images_)
++i == n && callback(Ox.len(images) ? images : void 0); ++i == n && callback(Ox.len(images) ? images : void 0);
}); });