From bbe62527d2ab9dde785ce38cac9998218c052ae3 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Thu, 5 Jun 2025 08:40:01 +0000 Subject: [PATCH] Remove pointless DOM call --- public/scripts/world-info.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 853a32810..c0ace1b7a 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1942,7 +1942,6 @@ function clearEntryList() { console.time('clearEntryList'); const $list = $('#world_popup_entries_list'); - if (!$list.children().length) { console.debug('List already empty, skipping cleanup.'); console.timeEnd('clearEntryList'); @@ -1977,7 +1976,6 @@ function clearEntryList() { $select.off(); $.cleanData([$select[0]]); - }); // Step 3: Clean
, , @@ -1993,13 +1991,12 @@ function clearEntryList() { $list.sortable('destroy'); } - let totalElementsOfanyKindLeftInList = $list.children().length; + const totalElementsOfAnyKindLeftInList = $list.children().length; // Final cleanup - if (totalElementsOfanyKindLeftInList !== 0) { + if (totalElementsOfAnyKindLeftInList) { console.time('empty'); $list.empty(); - totalElementsOfanyKindLeftInList = $list.children().length; console.timeEnd('empty'); }