150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
-
-
+
+
|
_capacity *= 2;
if (_capacity < MIN_CAPACITY)
_capacity = MIN_CAPACITY;
_buckets = OFAllocZeroedMemory(_capacity, sizeof(*_buckets));
if (of_hash_seed != 0)
_rotate = of_random16() & 31;
if (OFHashSeed != 0)
_rotate = OFRandom16() & 31;
} @catch (id e) {
[self release];
@throw e;
}
return self;
}
|
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
|
-
-
+
+
|
_capacity = MIN_CAPACITY;
_buckets = OFResizeMemory(_buckets, _capacity, sizeof(*_buckets));
/*
* Get a new random value for _rotate, so that it is not less secure
* than creating a new hash map.
*/
if (of_hash_seed != 0)
_rotate = of_random16() & 31;
if (OFHashSeed != 0)
_rotate = OFRandom16() & 31;
}
- (bool)containsObject: (void *)object
{
if (object == NULL || _count == 0)
return false;
|