ObjFW  Diff

Differences From Artifact [13e9a659c3]:

To Artifact [82272ab977]:


196
197
198
199
200
201
202

203

204
205
206
207
208
209
210
196
197
198
199
200
201
202
203

204
205
206
207
208
209
210
211







+
-
+







	struct weak_ref *ref;

#ifdef OF_HAVE_THREADS
	if (!of_spinlock_lock(&spinlock))
		OBJC_ERROR("Failed to lock spinlock!")
#endif

	if (*object != nil &&
	if ((ref = objc_hashtable_get(hashtable, *object)) != NULL)
	    (ref = objc_hashtable_get(hashtable, *object)) != NULL)
		value = *object;

#ifdef OF_HAVE_THREADS
	if (!of_spinlock_unlock(&spinlock))
		OBJC_ERROR("Failed to unlock spinlock!")
#endif

246
247
248
249
250
251
252

253

254
255
256
257
258
259
260
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
262







+
-
+







	struct weak_ref *ref;

#ifdef OF_HAVE_THREADS
	if (!of_spinlock_lock(&spinlock))
		OBJC_ERROR("Failed to lock spinlock!")
#endif

	if (*src != nil &&
	if ((ref = objc_hashtable_get(hashtable, *src)) != NULL) {
	    (ref = objc_hashtable_get(hashtable, *src)) != NULL) {
		for (size_t i = 0; i < ref->count; i++) {
			if (ref->locations[i] == src) {
				ref->locations[i] = dest;
				break;
			}
		}
	}