~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
algorithms.c: Set `hashsz', `tagsz', and `name' properties on MAC keys.
[catacomb-python]
/
catacomb
/
__init__.py
diff --git
a/catacomb/__init__.py
b/catacomb/__init__.py
index
0e5c31c
..
26463b4
100644
(file)
--- a/
catacomb/__init__.py
+++ b/
catacomb/__init__.py
@@
-658,10
+658,10
@@
class _tmp:
def check(me, sz): return me.min <= sz <= me.max and sz%me.mod == 0
def best(me, sz):
if sz < me.min: raise ValueError('key too small')
def check(me, sz): return me.min <= sz <= me.max and sz%me.mod == 0
def best(me, sz):
if sz < me.min: raise ValueError('key too small')
- elif sz > me.max: return me.max
+ elif
me.max is not None and
sz > me.max: return me.max
else: return sz - sz%me.mod
def pad(me, sz):
else: return sz - sz%me.mod
def pad(me, sz):
- if sz > me.max: raise ValueError('key too large')
+ if
me.max is not None and
sz > me.max: raise ValueError('key too large')
elif sz < me.min: return me.min
else: sz += me.mod - 1; return sz - sz%me.mod
_augment(KeySZRange, _tmp)
elif sz < me.min: return me.min
else: sz += me.mod - 1; return sz - sz%me.mod
_augment(KeySZRange, _tmp)