chiark
/
gitweb
/
~mdw
/
catacomb-python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f77c6b6
)
catacomb/__init__.py (KeySZRange.pad): Return correct value.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 17 Nov 2019 23:23:41 +0000
(23:23 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 27 Nov 2019 15:11:29 +0000
(15:11 +0000)
If the input is already a multiple of the modulus, then don't round up
to the next one.
catacomb/__init__.py
patch
|
blob
|
blame
|
history
diff --git
a/catacomb/__init__.py
b/catacomb/__init__.py
index 9178475b2d6faf4d3153e064e5f04f94633ea0f7..65695bb89bc2dfa4af84f30f0b647254a5c0d2c9 100644
(file)
--- a/
catacomb/__init__.py
+++ b/
catacomb/__init__.py
@@
-623,7
+623,7
@@
class _tmp:
def pad(me, sz):
if sz > me.max: raise ValueError, 'key too large'
elif sz < me.min: return me.min
def pad(me, sz):
if sz > me.max: raise ValueError, 'key too large'
elif sz < me.min: return me.min
- else: sz += me.mod; return sz - sz%me.mod
+ else: sz += me.mod
- 1
; return sz - sz%me.mod
_augment(KeySZRange, _tmp)
class _tmp:
_augment(KeySZRange, _tmp)
class _tmp: