From d0840e617127d115cbf048705e6f9ec6cd0afcff Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 15 Nov 2022 22:48:10 +0100 Subject: [PATCH] Swap check for slightly better performance --- lib/iproute2mapping/mapping.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iproute2mapping/mapping.go b/lib/iproute2mapping/mapping.go index 5b2e6c0..7cb0686 100644 --- a/lib/iproute2mapping/mapping.go +++ b/lib/iproute2mapping/mapping.go @@ -55,7 +55,7 @@ func readFromFile(filePath string) (mapByName map[string]int, mapById map[int]st // Go through file line-by-line for scanner.Scan() { text := scanner.Text() - if(strings.HasPrefix(text, "#") || text == ""){ + if(text == "" || strings.HasPrefix(text, "#")){ continue }