commit 6caa3c31428d06d4c64d5dadcb58bb13a7cdf939
parent 98931e548f0689e43cbd4ee6036d31bfef19f023
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Thu, 17 Nov 2022 12:29:13 -0500
simplify
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/cmd/art/main.go b/cmd/art/main.go
@@ -137,8 +137,7 @@ func getClassName(idx int) string {
const firstRune = 'a'
const lastRune = 'z'
out := []rune{firstRune}
- for idx > 0 {
- idx--
+ for i := idx; i > 0; i-- {
out[0]++
// If first letter reached "z", increment the next one which is not yet at "z"
// If we did not find a suitable letter to increment, let's add a new one in the array, and reset all to "a".