203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count_
{
size_t count = [array count];
if (state->state >= count)
return 0;
state->state = count;
state->itemsPtr = [array cArray];
state->mutationsPtr = &mutations;
return count;
}
- (OFEnumerator*)objectEnumerator
{
return [[[OFArrayEnumerator alloc]
initWithDataArray: array
mutationsPointer: &mutations] autorelease];
|
>
>
>
|
|
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count_
{
size_t count = [array count];
if (count > INT_MAX)
@throw [OFOutOfRangeException newWithClass: isa];
if (state->state >= count)
return 0;
state->state = count;
state->itemsPtr = [array cArray];
state->mutationsPtr = &mutations;
return (int)count;
}
- (OFEnumerator*)objectEnumerator
{
return [[[OFArrayEnumerator alloc]
initWithDataArray: array
mutationsPointer: &mutations] autorelease];
|