cowprotocol/solver-rewards

Use const and reduce for Accumulator

Closed this issue · 1 comments

Late to the party, but here you should use a const
You don't reassign the variable later, you only mutate the map it holds.

Also, you could do this using a reduce instead, which makes the variable unnecessary.

Something like:

return transfers.reduce((acc, transfer) =>{...}, new Map<string, bigint>())

Originally posted by @alfetopito in #234 (comment)

Won't fix... wasted too much time already.