diff --git a/trunk/ripnews/set/intspan.rb b/trunk/ripnews/set/intspan.rb index a161333..bbcd3b7 100644 --- a/trunk/ripnews/set/intspan.rb +++ b/trunk/ripnews/set/intspan.rb @@ -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