Differences From Artifact [c2dcb9f429]:
- File src/OFSet.m — part of check-in [6228b691b5] at 2022-06-12 06:27:14 on branch trunk — Remove a few useless methods (user: js, size: 8028) [annotate] [blame] [check-ins using] [more...]
To Artifact [bebf07d610]:
- File
src/OFSet.m
— part of check-in
[27d8eb922d]
at
2023-07-15 23:44:25
on branch trunk
— Never set mutationsPtr to self
The Apple runtime can store the retain count in isa, so
retaining/releasing an object would suddenly make it seem like it was
mutated. (user: js, size: 7177) [annotate] [blame] [check-ins using] [more...]
1 | 1 2 3 4 5 6 7 8 9 | - + | /* |
︙ | |||
18 19 20 21 22 23 24 | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - | #include <stdlib.h> #import "OFSet.h" #import "OFArray.h" #import "OFMapTableSet.h" #import "OFNull.h" #import "OFString.h" |
︙ | |||
68 69 70 71 72 73 74 | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - - - | - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { return (id)[[OFMapTableSet alloc] initWithObject: firstObject arguments: arguments]; } |
︙ | |||
190 191 192 193 194 195 196 | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - - - - - | } - (instancetype)initWithObject: (id)firstObject arguments: (va_list)arguments { OF_INVALID_INIT_METHOD } |
︙ | |||
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | + - + | OF_UNRECOGNIZED_SELECTOR } - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { static unsigned long dummyMutations; OFEnumerator *enumerator; int i; memcpy(&enumerator, state->extra, sizeof(enumerator)); if (enumerator == nil) { enumerator = [self objectEnumerator]; memcpy(state->extra, &enumerator, sizeof(enumerator)); } state->itemsPtr = objects; |
︙ | |||
358 359 360 361 362 363 364 | 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | - - - - - - - - - - - - - - - - - - - - - - - - - | for (id object in self) if ([set containsObject: object]) return true; return false; } |
︙ |