From f8a5cfc0487d56ae443f0b2080bda28abb5296c7 Mon Sep 17 00:00:00 2001 From: Divvy Seldome Date: Sat, 29 May 2021 23:42:16 +0200 Subject: [PATCH 1/2] don't double check bools Replace a "BOOLEXPR == true" to "BOOLEXPR" as it makes the same sense. Same goes with the negative included in this patch. --- chia-log-analyzer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chia-log-analyzer.go b/chia-log-analyzer.go index a265eef..f05a0cf 100644 --- a/chia-log-analyzer.go +++ b/chia-log-analyzer.go @@ -320,7 +320,7 @@ func parseLines(lines []string) { if s == "" { continue } - if startParsingLines == false { + if !startParsingLines { if lastRow == "" { //first run ? startParsingLines = true } else { @@ -335,7 +335,7 @@ func parseLines(lines []string) { lastRow = s - if regexPlotsFarming.MatchString(s) == true { + if regexPlotsFarming.MatchString(s) { lastParsedLinesStack.push(s) match := regexPlotsFarming.FindStringSubmatch(s) From 5a11567fd0d557ad7ce68090598f5affba8f1248 Mon Sep 17 00:00:00 2001 From: Divvy Seldome Date: Sat, 29 May 2021 23:44:52 +0200 Subject: [PATCH 2/2] reduce unnecessary else --- chia-log-analyzer.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chia-log-analyzer.go b/chia-log-analyzer.go index f05a0cf..96220e9 100644 --- a/chia-log-analyzer.go +++ b/chia-log-analyzer.go @@ -326,10 +326,8 @@ func parseLines(lines []string) { } else { if lastRow == s { startParsingLines = true - continue - } else { - continue } + continue } }