Avoid excess divides in the amount < min bucket scoring loop
authorMatt Corallo <git@bluematt.me>
Sat, 16 Dec 2023 02:12:42 +0000 (02:12 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 16 Dec 2023 04:01:01 +0000 (04:01 +0000)
commit7408a4b5bb6f6ff0637935dc753e9cbc39b2c7fa
treeae7b740fd1e54461c44b9d931c45c999284dee50
parent41f747bc63a232db98d45cfd79e9b3947c67a588
Avoid excess divides in the amount < min bucket scoring loop

When we iterate over buckets in the "the amount we're sending is
smaller than the minimum bucket we're looking at", there is no need
to divide by the total points tracked until we've summed all the
buckets. Here we pull that divide out to the end, removing one of
the hottest single instructions in our scoring logic.
lightning/src/routing/scoring.rs