Skip to content
Browse files

dont try mutating an NSMutableSet while iterating (thx jesse g.)

  • Loading branch information...
1 parent e3ee60c commit 02aebf3d116dedad26b5d2e9de8b3ee16df5ef79 Todd Ditchendorf committed Apr 28, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/PKDifference.m
  2. +1 −1 src/PKIntersection.m
View
2 src/PKDifference.m
@@ -21,7 +21,7 @@ - (void)minusSetTestingEquality:(NSSet *)s;
@implementation NSMutableSet (PKDifferenceAdditions)
- (void)minusSetTestingEquality:(NSSet *)s {
- for (id a1 in self) {
+ for (id a1 in [[self copy] autorelease]) {
for (id a2 in s) {
if ([a1 isEqual:a2]) {
[self removeObject:a1];
View
2 src/PKIntersection.m
@@ -22,7 +22,7 @@ - (void)intersectSetTestingEquality:(NSSet *)s;
@implementation NSMutableSet (PKIntersectionAdditions)
- (void)intersectSetTestingEquality:(NSSet *)s {
- for (id a1 in self) {
+ for (id a1 in [[self copy] autorelease]) {
BOOL found = NO;
for (id a2 in s) {
if ([a1 isEqual:a2]) {

0 comments on commit 02aebf3

Please sign in to comment.
Something went wrong with that request. Please try again.