aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2008-01-23 14:44:06 +0000
committerRob Austein <sra@hactrn.net>2008-01-23 14:44:06 +0000
commit86b87c78f6b5a05a003f20c6f13ddbd70041fe0e (patch)
treee67382e6fa7847473efb7146fe7b4389345f95f6 /scripts
parentf195bbbae865b649a5f05e8ce664356e1dc2dc30 (diff)
resource_set.union() wasn't mergin adjacent ranges
svn path=/scripts/rpki/resource_set.py; revision=1494
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rpki/resource_set.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/rpki/resource_set.py b/scripts/rpki/resource_set.py
index 64b18b6f..8497dad5 100644
--- a/scripts/rpki/resource_set.py
+++ b/scripts/rpki/resource_set.py
@@ -221,6 +221,10 @@ class resource_set(list):
if this.max > that.max: max = this.max
else: max = that.max
result.append(type(this)(min, max))
+ for i in range(len(result) - 2, -1, -1):
+ if result[i].max + 1 == result[i + 1].min:
+ result[i].max = result[i + 1].max
+ result.pop(i + 1)
return type(self)(result)
def intersection(self, other):