ObjFW  Diff

Differences From Artifact [2747b40d13]:

To Artifact [3f8cbae000]:


74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	struct objc_hashtable_bucket *bucket;

	hash = objc_hash_string(key);
	assert(h->count + 1 <= UINT32_MAX / 4);

	if ((h->count + 1) * 4 / (h->last_idx + 1) >= 3) {
		struct objc_hashtable_bucket **ndata;
		uint32_t nsize = (h->last_idx + 1) << 1;

		assert(nsize > 0);

		ndata = malloc(nsize * sizeof(struct objc_hashtable_bucket*));
		if (ndata == NULL)
			OBJC_ERROR("Not enough memory to insert into hash "
			    "table!");







|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
	struct objc_hashtable_bucket *bucket;

	hash = objc_hash_string(key);
	assert(h->count + 1 <= UINT32_MAX / 4);

	if ((h->count + 1) * 4 / (h->last_idx + 1) >= 3) {
		struct objc_hashtable_bucket **ndata;
		uint32_t nsize = (h->last_idx + 1) * 2;

		assert(nsize > 0);

		ndata = malloc(nsize * sizeof(struct objc_hashtable_bucket*));
		if (ndata == NULL)
			OBJC_ERROR("Not enough memory to insert into hash "
			    "table!");