Commit c690f77e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix minor range issues

parent 564168c3
......@@ -3,7 +3,7 @@ all: compile-all
compile-all:
@pyside-rcc asn1_value_editor.qrc -o asn1_value_editor/resources.py
install: compile-all
install:
@python setup.py install --record install.record
clean:
......
......@@ -84,13 +84,13 @@ def compute_combinations(asn1_ty, pool):
yield each
def compute_integer_combinations(asn1_ty, max_iter=None):
def compute_integer_combinations(asn1_ty, max_iter=0):
''' Generator returning all integer values, with optional limit '''
# Do not use xrange, it needs a value that fits in a C long
max_iter = (long(asn1_ty.Min)
+ max_iter) if max_iter != 0 else long(asn1_ty.Max)
for each in itertools.count(long(asn1_ty.Min)):
if each == max_iter:
if each > max_iter:
break
yield str(each)
......@@ -137,7 +137,7 @@ def compute_sequence_combinations(asn1_ty, pool):
def compute_sequenceof_combinations(asn1_ty, pool):
''' Generator returning all combinations of arrays '''
for size in xrange(int(asn1_ty.Min), int(asn1_ty.Max)):
for size in xrange(int(asn1_ty.Min), int(asn1_ty.Max) + 1):
elems = []
for _ in xrange(size):
elems.append(compute_combinations(asn1_ty, pool))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment