Differences From Artifact [460faa4705]:
- File src/OFMutableSet.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 4008) [annotate] [blame] [check-ins using] [more...]
To Artifact [247e02065c]:
- File
src/OFMutableSet.m
— part of check-in
[0ddaac3f5b]
at
2020-11-05 00:24:29
on branch trunk
— Avoid -[allocMemoryWithSize:] for temporary memory
-[allocMemoryWithSize:] has book keeping overhead that is unnecessary
for temporary memory. (user: js, size: 3962) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
168 169 170 171 172 173 174 | - (void)intersectSet: (OFSet *)set { void *pool = objc_autoreleasePoolPush(); size_t count = self.count; id *cArray; | < < | | | 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 193 194 195 196 | - (void)intersectSet: (OFSet *)set { void *pool = objc_autoreleasePoolPush(); size_t count = self.count; id *cArray; cArray = of_malloc(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 { |
︙ | ︙ |