summaryrefslogtreecommitdiff
path: root/tikzit/src/common/Graph.m
diff options
context:
space:
mode:
Diffstat (limited to 'tikzit/src/common/Graph.m')
-rw-r--r--tikzit/src/common/Graph.m17
1 files changed, 8 insertions, 9 deletions
diff --git a/tikzit/src/common/Graph.m b/tikzit/src/common/Graph.m
index e83a99c..8bf8dfa 100644
--- a/tikzit/src/common/Graph.m
+++ b/tikzit/src/common/Graph.m
@@ -465,7 +465,7 @@
}
}
}
-
+
[graphLock unlock];
}
@@ -481,16 +481,16 @@
- (Graph*)copyOfSubgraphWithNodes:(NSSet*)nds {
[graphLock lock];
-
+
NSMapTable *newNds = [Graph nodeTableForNodes:nds];
Graph* newGraph = [[Graph graph] retain];
-
+
NSEnumerator *en = [newNds objectEnumerator];
Node *nd;
while ((nd = [en nextObject])) {
[newGraph addNode:nd];
}
-
+
en = [edges objectEnumerator];
Edge *e;
while ((e = [en nextObject])) {
@@ -502,20 +502,20 @@
[e1 release]; // e1 belongs to newGraph
}
}
-
+
[graphLock unlock];
-
+
return newGraph;
}
- (NSSet*)pathCover {
[self sync];
- NSMutableSet *remainingEdges = [NSMutableSet setWithArray:edges];
NSMutableSet *cover = [NSMutableSet set];
-
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSMutableSet *remainingEdges = [NSMutableSet setWithArray:edges];
+
while ([remainingEdges count] != 0) {
NSMutableArray *path = [[NSMutableArray alloc] init];
NSSet *succs;
@@ -542,7 +542,6 @@
}
[pool drain];
- [remainingEdges release];
return cover;
}