Skip to content

Commit c7d2a39

Browse files
author
Bálint Kemény
committed
Clean up some unnecessary lines
1 parent 9f9dc55 commit c7d2a39

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Day14/main.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,19 @@ func replaceX(in string) []string {
3030
rsO1 := []rune(o1)
3131
rsO2 := []rune(o2)
3232
var result []string
33-
var foundX bool
3433
for i, r := range rsI {
3534
if r == 'X' {
36-
foundX = true
3735
rsO1[i] = '0'
3836
rsO2[i] = '1'
3937
outSlice1 := replaceX(string(rsO1))
4038
outSlice2 := replaceX(string(rsO2))
4139
result = append(result, outSlice1...)
4240
result = append(result, outSlice2...)
43-
break
41+
return result
4442
}
4543
}
4644

47-
if !foundX {
48-
result = append(result, in)
49-
}
45+
result = append(result, in)
5046
return result
5147
}
5248

0 commit comments

Comments
 (0)