Commit c020ce1c authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Fix: create sets on demand

parent d9c2084d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class Slice {
        for (Node node : nodes) {
            Optional<CompilationUnit> cu = node.findCompilationUnit();
            if (cu.isEmpty()) continue;
            cuMap.putIfAbsent(cu.get(), new NodeHashSet<>());
            cuMap.computeIfAbsent(cu.get(), compilationUnit -> new NodeHashSet<>());
            cuMap.get(cu.get()).add(node);
        }
        // Traverse the AST of each compilation unit, creating a copy and