mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
no need to acess the array 3 times
This commit is contained in:
parent
daea5be5f1
commit
c75c46aa9d
@ -101,9 +101,9 @@ function store_cape(uuid, profile, details, callback) {
|
|||||||
var currently_running = [];
|
var currently_running = [];
|
||||||
function callback_for(uuid, type, err, hash) {
|
function callback_for(uuid, type, err, hash) {
|
||||||
for (var i = 0; i < currently_running.length; i++) {
|
for (var i = 0; i < currently_running.length; i++) {
|
||||||
if (currently_running[i].uuid === uuid && currently_running[i].type === type) {
|
var current = currently_running[i];
|
||||||
var will_call = currently_running[i];
|
if (current.uuid === uuid && current.type === type) {
|
||||||
will_call.callback(err, hash);
|
current.callback(err, hash);
|
||||||
currently_running.splice(i, 1); // remove from array
|
currently_running.splice(i, 1); // remove from array
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user