57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
static bool
defaultEqual(void *object1, void *object2)
{
return (object1 == object2);
}
@interface OFMapTable ()
- (void)of_setObject: (void *)object
forKey: (void *)key
hash: (uint32_t)hash;
@end
@interface OFMapTableEnumerator ()
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct of_map_table_bucket **)buckets
capacity: (uint32_t)capacity
mutationsPointer: (unsigned long *)mutationsPtr
OF_METHOD_FAMILY(init);
@end
|
>
>
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
static bool
defaultEqual(void *object1, void *object2)
{
return (object1 == object2);
}
OF_DIRECT_MEMBERS
@interface OFMapTable ()
- (void)of_setObject: (void *)object
forKey: (void *)key
hash: (uint32_t)hash;
@end
OF_DIRECT_MEMBERS
@interface OFMapTableEnumerator ()
- (instancetype)of_initWithMapTable: (OFMapTable *)mapTable
buckets: (struct of_map_table_bucket **)buckets
capacity: (uint32_t)capacity
mutationsPointer: (unsigned long *)mutationsPtr
OF_METHOD_FAMILY(init);
@end
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
|
if (_keyFunctions.equal(_buckets[i]->key, key))
return _buckets[i]->object;
}
return NULL;
}
- (void)of_resizeForCount: (uint32_t)count
{
uint32_t fullness, capacity;
struct of_map_table_bucket **buckets;
if (count > UINT32_MAX / sizeof(*_buckets) || count > UINT32_MAX / 8)
@throw [OFOutOfRangeException exception];
|
|
|
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
|
if (_keyFunctions.equal(_buckets[i]->key, key))
return _buckets[i]->object;
}
return NULL;
}
- (void)of_resizeForCount: (uint32_t)count OF_DIRECT
{
uint32_t fullness, capacity;
struct of_map_table_bucket **buckets;
if (count > UINT32_MAX / sizeof(*_buckets) || count > UINT32_MAX / 8)
@throw [OFOutOfRangeException exception];
|