164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
- (void)intersectSet: (OFSet *)set
{
void *pool = objc_autoreleasePoolPush();
size_t count = self.count;
id *cArray;
cArray = of_alloc(count, sizeof(id));
@try {
size_t i;
i = 0;
for (id object in self) {
assert(i < count);
cArray[i++] = object;
}
for (i = 0; i < count; i++)
if (![set containsObject: cArray[i]])
[self removeObject: cArray[i]];
} @finally {
free(cArray);
}
objc_autoreleasePoolPop(pool);
}
- (void)unionSet: (OFSet *)set
{
|
|
|
|
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
- (void)intersectSet: (OFSet *)set
{
void *pool = objc_autoreleasePoolPush();
size_t count = self.count;
id *cArray;
cArray = OFAllocMemory(count, sizeof(id));
@try {
size_t i;
i = 0;
for (id object in self) {
assert(i < count);
cArray[i++] = object;
}
for (i = 0; i < count; i++)
if (![set containsObject: cArray[i]])
[self removeObject: cArray[i]];
} @finally {
OFFreeMemory(cArray);
}
objc_autoreleasePoolPop(pool);
}
- (void)unionSet: (OFSet *)set
{
|