From f8021955e60c65630eb67d6091587e2f5855c7e4 Mon Sep 17 00:00:00 2001 From: p2r3 Date: Thu, 17 Oct 2024 18:40:21 +0300 Subject: [PATCH] style(elocamp): improve code readability --- util/weeklog.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/util/weeklog.js b/util/weeklog.js index 245720d..f097251 100644 --- a/util/weeklog.js +++ b/util/weeklog.js @@ -53,7 +53,9 @@ function parseLog (buffer, categoryList, forcePurge = false) { if (entry.time === 0) { // the portal count byte denotes whether to purge the run from the output entirely - if (!forcePurge && entry.portals === 0) continue; + const purge = entry.portals === 0; + // if we're not purging, just ignore this marker and do nothing + if (!forcePurge && !purge) continue; for (let j = log.length - 1; j >= 0; j --) { // look for the last run by the same user in the same category and remove it @@ -63,10 +65,11 @@ function parseLog (buffer, categoryList, forcePurge = false) { } } - continue; - } + } else { + + log.push(entry); - log.push(entry); + } }