Closed ggutoski closed 3 years ago
https://github.com/axelarnetwork/tofn/blob/bf81a677cae92520f97a4a28f1188a7d927f428d/src/fillvec.rs#L30-L34 This method increments some_count regardless of whether stored was Some or None. If stored was Some then some_count should not be incremented.
some_count
stored
Some
None
The fix is to increment some_count only when stored was None.
It's a miracle we went so long without noticing this problem.
https://github.com/axelarnetwork/tofn/blob/bf81a677cae92520f97a4a28f1188a7d927f428d/src/fillvec.rs#L30-L34 This method increments
some_count
regardless of whetherstored
wasSome
orNone
. Ifstored
wasSome
thensome_count
should not be incremented.The fix is to increment
some_count
only whenstored
wasNone
.It's a miracle we went so long without noticing this problem.