From: Mark Wooding Date: Sun, 17 Nov 2019 23:23:41 +0000 (+0000) Subject: catacomb/__init__.py (KeySZRange.pad): Return correct value. X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/commitdiff_plain/8fc76cc0e1dea41218fca11b3405183252e7f57f catacomb/__init__.py (KeySZRange.pad): Return correct value. If the input is already a multiple of the modulus, then don't round up to the next one. --- diff --git a/catacomb/__init__.py b/catacomb/__init__.py index 9178475..65695bb 100644 --- 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 - else: sz += me.mod; return sz - sz%me.mod + else: sz += me.mod - 1; return sz - sz%me.mod _augment(KeySZRange, _tmp) class _tmp: