]> arthur.barton.de Git - bup.git/commit
bloom: fix logic controlling bloom regeneration
authorRob Browning <rlb@defaultvalue.org>
Sun, 12 Jan 2020 21:33:15 +0000 (15:33 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sun, 12 Jan 2020 21:49:58 +0000 (15:49 -0600)
commitb86fb21ae670f8d1dc42d26bd69252cb9cc0ab7f
treed0163ade041f9f98d544431d1b5e12c04f566d71
parent5dcd9acd912fda2259ec323a2a06666e0b01db49
bloom: fix logic controlling bloom regeneration

Add missing MAX_BLOOM_BITS index in the logic in bup bloom that
determines whether or not we should regenerate the filter.  We never
noticed because:

  $ python2
  >>> 0 < {1 : 2}
  True

  $ python3
  >>> 0 < {1 : 2}
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: '<' not supported between instances of 'int' and 'dict'

Also regnerate if the -k value differs from the existing filter's k.

Thanks to Johannes Berg for pointing out some nontrivial problems in
an earlier version.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/bloom-cmd.py