From 1c2c7f0956bedf86f855f9b79cf376982599daf0 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 28 Jan 2015 23:35:53 +0100 Subject: [PATCH] use splice instead of delete `delete` replaces the value with undefined and doesn't shrink the array size `splice` actually removes the value and shrinkgs the array size --- modules/helpers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/helpers.js b/modules/helpers.js index b3907a6..3df4263 100644 --- a/modules/helpers.js +++ b/modules/helpers.js @@ -81,7 +81,7 @@ function store_cape(uuid, profile, details, callback) { } else { skins.save_image(img, capepath, function(err) { logging.log(uuid + " cape saved"); - callback(err, hash); + callback(err, hash); }); } }); @@ -104,8 +104,8 @@ function callback_for(uuid, which, err, cape_hash, skin_hash) { if (currently_running[i] && currently_running[i].uuid === uuid && (currently_running[i].which === which || which === null)) { var will_call = currently_running[i]; will_call.callback(err, will_call.which === 'skin' ? skin_hash : cape_hash); - //remove_from_array(currently_running, i); - delete(currently_running[i]); + currently_running.splice(i, 1); // remove from array + i--; } } }