Skip to content

Commit 765cba0

Browse files
Refactor func
1 parent 20ae048 commit 765cba0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

2022/day01/day01.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
}
1616

1717
func partOne(lines []string) {
18-
elfCaloriesMap := getAllocatedCaloriesPerElf(lines)
18+
elfCaloriesMap := getSummedUpCaloriesPerElf(lines)
1919
elf, calories := getElfMostCalories(elfCaloriesMap)
2020
log.Println(elf, calories)
2121
}
@@ -32,7 +32,7 @@ func getElfMostCalories(elfMap map[string]int) (string, int) {
3232
return elf, calories
3333
}
3434

35-
func getAllocatedCaloriesPerElf(lines []string) map[string]int {
35+
func getSummedUpCaloriesPerElf(lines []string) map[string]int {
3636
var elfCalories = make(map[string]int)
3737
var elfNumber = 1
3838
for _, stringCalories := range lines {

0 commit comments

Comments
 (0)