From 9b74a151b2e387aba5bf17644434fadd5d9d2e55 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 31 Jul 2018 08:06:34 -0400 Subject: [PATCH] Make JS varaible "current" local to the event handler Save a tiny amount of memory by not keeping the value around. Only used by the event handler. The value does not need to be remembered across different invocations of the event handler. --- debug_toolbar/static/debug_toolbar/js/toolbar.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 7fddbb208..84ac8548c 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -7,12 +7,11 @@ isReady: false, init: function() { $('#djDebug').show(); - var current = null; $('#djDebugPanelList').on('click', 'li a', function() { if (!this.className) { return false; } - current = $('#djDebug #' + this.className); + var current = $('#djDebug #' + this.className); if (current.is(':visible')) { $(document).trigger('close.djDebug'); $(this).parent().removeClass('djdt-active');