893 has a non-obvious optimization which can reduce number of iterations but kinda unintuitive.
suppose we only have 1 active address, starting get_total_balance with None as the starter and 1 as limit, how many calls should we have? in my opinion, it should go like
first run, returns (bal, <active address>)
second run using that active address as starter (note it's exclusive on starter), returns (0, 0x0)
however previous code in #893 only needs one run returning (bal, 0x0) which essentially just looks ahead and skips that address when counting the total balance.
it's not wrong, but I prefer the more straightforward logic.
893 has a non-obvious optimization which can reduce number of iterations but kinda unintuitive.
suppose we only have 1 active address, starting
get_total_balance
withNone
as thestarter
and 1 aslimit
, how many calls should we have? in my opinion, it should go like(bal, <active address>)
starter
), returns(0, 0x0)
however previous code in #893 only needs one run returning
(bal, 0x0)
which essentially just looks ahead and skips that address when counting the total balance.it's not wrong, but I prefer the more straightforward logic.