From 1c94bd658c2469f9ca9f465db82e71b6f7d2bfe8 Mon Sep 17 00:00:00 2001 From: RaindropsSys Date: Mon, 24 Jun 2024 15:17:24 +0200 Subject: Fix regex performance --- updater/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updater/main.js b/updater/main.js index d70bd51..15ca4dc 100755 --- a/updater/main.js +++ b/updater/main.js @@ -48,7 +48,7 @@ app.whenReady().then(() => { let lines = d.trim().split("\n"); let line = lines[lines.length - 1]; - let lineProcessed = line.replace(/^(\d+) (\d|.)+M .*$/gm, "$1").trim(); + let lineProcessed = line.replace(/^(\d+) (\d|\.)+M .*$/gm, "$1").trim(); if (lineProcessed !== line && !isNaN(parseInt(lineProcessed))) { percent = lineProcessed; } @@ -78,7 +78,7 @@ app.whenReady().then(() => { let lines = d.trim().split("\n"); let line = lines[lines.length - 1]; - let lineProcessed = line.replace(/^(\d+) (\d|.)+M .*$/gm, "$1").trim(); + let lineProcessed = line.replace(/^(\d+) (\d|\.)+M .*$/gm, "$1").trim(); if (lineProcessed !== line && !isNaN(parseInt(lineProcessed))) { percent = lineProcessed; } -- cgit