summary refs log tree commit diff stats
path: root/compiler/nimsets.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/nimsets.nim')
-rwxr-xr-xcompiler/nimsets.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim
index 282188c64..14e9ae726 100755
--- a/compiler/nimsets.nim
+++ b/compiler/nimsets.nim
@@ -47,9 +47,9 @@ proc inSet(s: PNode, elem: PNode): bool =
 proc overlap(a, b: PNode): bool = 
   if a.kind == nkRange: 
     if b.kind == nkRange: 
+      # X..Y and C..D overlap iff (X <= D and C <= Y)
       result = leValue(a.sons[0], b.sons[1]) and
-          leValue(b.sons[1], a.sons[1]) or
-          leValue(a.sons[0], b.sons[0]) and leValue(b.sons[0], a.sons[1])
+               leValue(b.sons[0], a.sons[1])
     else:
       result = leValue(a.sons[0], b) and leValue(b, a.sons[1])
   else: