Remove pointless DOM call
| @@ -1942,7 +1942,6 @@ function clearEntryList() { | |||
| 1942 | console.time('clearEntryList'); | 1942 | console.time('clearEntryList'); |
| 1943 | const $list = $('#world_popup_entries_list'); | 1943 | const $list = $('#world_popup_entries_list'); |
| 1944 | 1944 | ||
| 1945 | |||
| 1946 | if (!$list.children().length) { | 1945 | if (!$list.children().length) { |
| 1947 | console.debug('List already empty, skipping cleanup.'); | 1946 | console.debug('List already empty, skipping cleanup.'); |
| 1948 | console.timeEnd('clearEntryList'); | 1947 | console.timeEnd('clearEntryList'); |
| @@ -1977,7 +1976,6 @@ function clearEntryList() { | |||
| 1977 | 1976 | ||
| 1978 | $select.off(); | 1977 | $select.off(); |
| 1979 | $.cleanData([$select[0]]); | 1978 | $.cleanData([$select[0]]); |
| 1980 | |||
| 1981 | }); | 1979 | }); |
| 1982 | 1980 | ||
| 1983 | // Step 3: Clean <div>, <span>, <input> | 1981 | // Step 3: Clean <div>, <span>, <input> |
| @@ -1993,13 +1991,12 @@ function clearEntryList() { | |||
| 1993 | $list.sortable('destroy'); | 1991 | $list.sortable('destroy'); |
| 1994 | } | 1992 | } |
| 1995 | 1993 | ||
| 1996 | let totalElementsOfanyKindLeftInList = $list.children().length; | 1994 | const totalElementsOfAnyKindLeftInList = $list.children().length; |
| 1997 | 1995 | ||
| 1998 | // Final cleanup | 1996 | // Final cleanup |
| 1999 | if (totalElementsOfanyKindLeftInList !== 0) { | 1997 | if (totalElementsOfAnyKindLeftInList) { |
| 2000 | console.time('empty'); | 1998 | console.time('empty'); |
| 2001 | $list.empty(); | 1999 | $list.empty(); |
| 2002 | totalElementsOfanyKindLeftInList = $list.children().length; | ||
| 2003 | console.timeEnd('empty'); | 2000 | console.timeEnd('empty'); |
| 2004 | } | 2001 | } |
| 2005 | 2002 | ||