In commit “qt: Enqueue setProcessingQueuedTransactions(false) only once” (5ff42b72e93508dfae41e082bbbc7c7ee4aacf6b)
This is kind of hard to follow, and not 100% sure I understand it. IIUC, calling setProcessingQueuedTransactions
with false
argument turns on balloons, calling it with true
argument turns off balloons.
Previously if the queue size was more than 10
, balloons were turned off before looping through transactions. Then for every transaction starting at i >= size-10
(i.e. for the most recent 10 transactions) balloons were turned on before updating each transaction.
Now balloons are turned on at i == size-11
so an extra balloon will be shown. (For example if size is 11
, balloons are now turned on at i=0
instead of i=1
).
If this is right, I’d make a few suggestions:
- Update commit description to say what motivation for the change is: e.g. that this is a optimization not supposed to change behavior. Not a bugfix or something else.
- Drop
+ 1
term which does not seem correct
- Add comment before if statement like
// Re-enable balloons for the most recent 10 transactions
- Maybe write expression as
i == size-10
or i + 10 == size
instead of size == 10 + i
, which seems more obscure. The only variable in the expression is i
(everything else is constant) so it’s good to emphasize i
writing it at the beginning.