small refactor

This commit is contained in:
Matias Alejo Garcia 2014-09-19 15:26:57 -03:00
commit 810ce0bf5d

View file

@ -223,10 +223,7 @@ Storage.prototype.getWallets = function(cb) {
if (!l) if (!l)
return cb([]); return cb([]);
for (var ii in ids) { _.each(ids, function(id) {
// Create a closure for async calls.
(function() {
var id = ids[ii];
self.getName(id, function(name) { self.getName(id, function(name) {
wallets.push({ wallets.push({
id: id, id: id,
@ -238,8 +235,7 @@ Storage.prototype.getWallets = function(cb) {
return cb(wallets); return cb(wallets);
} }
}); });
})(); });
}
}); });
}; };