]> 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>
Sat, 25 Apr 2020 19:12:57 +0000 (14:12 -0500)
commit7c12364b0038d8dea2743bbdc3b43b73ef56e5e1
tree7f80963267955411856552bbdf94aea09e7fd095
parent0a4e906e732556fad6422f93532fed1d261585ee
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>
(cherry picked from commit b86fb21ae670f8d1dc42d26bd69252cb9cc0ab7f)
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/bloom-cmd.py