summary refs log tree commit diff stats
path: root/compiler/nimsets.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-01-28 00:47:55 +0200
committerZahary Karadjov <zahary@gmail.com>2013-01-28 00:47:55 +0200
commit6fc49914155ad7e96011c705e1749b4bb851165c (patch)
treedd70e80f21101ab8e78206b768518080f29f6fc3 /compiler/nimsets.nim
parent0cb95891d353d79cd50cb6f4eb83c9ca03a5a2ca (diff)
parentd5a5c2291f7b7cccb6f15edc05efca12638a3976 (diff)
downloadNim-6fc49914155ad7e96011c705e1749b4bb851165c.tar.gz
Merge remote-tracking branch 'upstream/master' into upstream
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: