Skip to content

Commit c42608f

Browse files
Very slight performance optimisation. Delete the auth keys from the object so we don't have to check for them to ignore later
1 parent 37e7da4 commit c42608f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/skins/classic/js/skin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,14 @@ if ( currentView != 'none' && currentView != 'login' ) {
491491
// Update authentication token.
492492
auth_hash = data.auth;
493493
}
494+
delete data.auth;
494495
}
495496
if (data.auth_relay) {
496497
auth_relay = data.auth_relay;
498+
delete data.auth_relay;
497499
}
498500
// iterate through all the keys then update each element id with the same name
499-
for (var key of Object.keys(data)) {
500-
if ( key == "auth" ) continue;
501-
if ( key == "auth_relay" ) continue;
501+
for (const key of Object.keys(data)) {
502502
if ( $j('#'+key).hasClass("show") ) continue; // don't update if the user has the dropdown open
503503
if ( $j('#'+key).length ) $j('#'+key).replaceWith(data[key]);
504504
if ( key == 'getBandwidthHTML' ) bwClickFunction();

0 commit comments

Comments
 (0)