fix _copy_array

This commit is contained in:
Ward Wouts 2002-04-27 23:41:29 +00:00
parent 081e28d836
commit b6f3ced015

View file

@ -67,15 +67,15 @@ def _copy_array(array) # copies an array into @set
@set["negInf"] = false
@set["posInf"] = false
print "scary thingy gets called!!!\n"
#print "scary thingy gets called!!!\n"
edges = []
for element in array.sort
next if edges and edges[-1] == element; # skip duplicates
next if (edges.length > 0) and (edges[-1] == element) # skip duplicates
if (edges and edges[-1] == $element-1)
edges[-1] = $element;
if (edges.length > 0) and (edges[-1] == element-1)
edges[-1] = element
else
push @edges, $element-1, $element;
edges += [ element-1, element ]
end
end
@ -886,7 +886,7 @@ end # module
# [x] valid
# [ ] copy
# [ ] _copy_empty # makes $set the empty set
# [ ] _copy_array # copies an array into a set
# [x] _copy_array # copies an array into a set
# [ ] _copy_set # copies one set to another
# [ ] _copy_run_list # parses a run list
# [ ] _cleanup