From 64fe9e73f060f09718daa0f406409923b1b4d1cb Mon Sep 17 00:00:00 2001 From: Linus Wagner Date: Thu, 7 Mar 2024 22:55:08 +0100 Subject: [PATCH] fix bug isDisjoined --- src/org/rascalmpl/library/Set.rsc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/rascalmpl/library/Set.rsc b/src/org/rascalmpl/library/Set.rsc index 82903b81253..ccaeb3d69d1 100644 --- a/src/org/rascalmpl/library/Set.rsc +++ b/src/org/rascalmpl/library/Set.rsc @@ -530,10 +530,10 @@ isDisjoined({{1,2}, {1,4}, {1,6}}); } public bool isDisjoined(set[set[&T]] sets) { list[set[&T]] setsAsList = toList(sets); - pairs = {}; - for (elem1 <- setsAsList) { - for (elem2 <- setsAsList[1..]) { - if (elem1 & elem2 != {}) return false; + + for (elem1 <- [0..size(setsAsList)-1]) { + for (elem2 <- [elem1+1..size(setsAsList)]) { + if (setsAsList[elem1] & setsAsList[elem2] != {}) return false; } }