ObjFW  Diff

Differences From Artifact [bcee3b5d39]:

To Artifact [021ca59238]:


161
162
163
164
165
166
167
168
169
170
171

172
173
174
175
176
177
178
179
180
181
161
162
163
164
165
166
167




168



169
170
171
172
173
174
175







-
-
-
-
+
-
-
-







		if (_capacity < MIN_CAPACITY)
			_capacity = MIN_CAPACITY;

		_buckets = [self allocZeroedMemoryWithSize: sizeof(*_buckets)
						     count: _capacity];

		if (of_hash_seed != 0)
#if defined(HAVE_ARC4RANDOM)
			_rotate = arc4random() & 31;
#elif defined(HAVE_RANDOM)
			_rotate = random() & 31;
			_rotate = of_random() & 31;
#else
			_rotate = rand() & 31;
#endif
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}
534
535
536
537
538
539
540
541
542
543
544

545
546
547
548
549
550
551
552
553
554
528
529
530
531
532
533
534




535



536
537
538
539
540
541
542







-
-
-
-
+
-
-
-







				count: _capacity];

	/*
	 * 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)
#if defined(HAVE_ARC4RANDOM)
		_rotate = arc4random() & 31;
#elif defined(HAVE_RANDOM)
		_rotate = random() & 31;
		_rotate = of_random() & 31;
#else
		_rotate = rand() & 31;
#endif
}

- (bool)containsObject: (void *)object
{
	if (object == NULL || _count == 0)
		return false;