From fc558d99f29c5333dd0b26428e48ec2b61d640ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sun, 8 Dec 2024 22:51:59 +0100 Subject: [PATCH] simplify loop --- uncrust.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/uncrust.go b/uncrust.go index a8a362e..456db8a 100644 --- a/uncrust.go +++ b/uncrust.go @@ -70,11 +70,8 @@ func main() { // We have to calculate the rune position from the byte position. rcount := 0 idx := 0 - cont := false for p := range before { - cont = false for i := range edits[idx:] { - cont = true if edits[i].Start == p { edits[i].Start = rcount } @@ -84,7 +81,7 @@ func main() { } } rcount++ - if !cont { + if idx == len(edits) { break } }