24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
- (void)_resizeForCount: (size_t)newcount
{
size_t fill = newcount * 4 / size;
size_t newsize;
struct of_dictionary_bucket *newdata;
uint32_t i;
if (newcount > SIZE_MAX / 4)
@throw [OFOutOfRangeException newWithClass: isa];
if (fill >= 3)
newsize = size << 1;
else if (fill <= 1)
newsize = size >> 1;
else
|
|
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
- (void)_resizeForCount: (size_t)newcount
{
size_t fill = newcount * 4 / size;
size_t newsize;
struct of_dictionary_bucket *newdata;
uint32_t i;
if (newcount > UINT32_MAX)
@throw [OFOutOfRangeException newWithClass: isa];
if (fill >= 3)
newsize = size << 1;
else if (fill <= 1)
newsize = size >> 1;
else
|
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
return [[OFDictionary alloc] initWithDictionary: self];
}
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count_
{
size_t i;
for (i = 0; i < count_; i++) {
for (; state->state < size && (data[state->state].key == nil ||
data[state->state].key == DELETED); state->state++);
if (state->state < size) {
objects[i] = data[state->state].key;
|
|
|
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
return [[OFDictionary alloc] initWithDictionary: self];
}
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
objects: (id*)objects
count: (int)count_
{
int i;
for (i = 0; i < count_; i++) {
for (; state->state < size && (data[state->state].key == nil ||
data[state->state].key == DELETED); state->state++);
if (state->state < size) {
objects[i] = data[state->state].key;
|