1
0

Use LinkedList.peekLast() to avoid walking the whole list

This commit is contained in:
Hubert Van De Walle 2020-12-18 12:30:13 +01:00
parent b0001697f5
commit b9d62c2835

View File

@ -58,7 +58,7 @@ class Day18(@Lines val input: Input<List<String>>) {
operands[i + 1] = result operands[i + 1] = result
} }
return operands.last() return operands.peekLast()
} else { } else {
var i = 0 var i = 0