ObjFW  Diff

Differences From Artifact [aec71097cd]:

To Artifact [c516ce707c]:


305
306
307
308
309
310
311









312
313
314
	return [[OFData alloc] initWithItems: _items
				    itemSize: _itemSize
				       count: _count];
}

- (void)makeImmutable
{









	object_setClass(self, [OFData class]);
}
@end







>
>
>
>
>
>
>
>
>



305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
	return [[OFData alloc] initWithItems: _items
				    itemSize: _itemSize
				       count: _count];
}

- (void)makeImmutable
{
	if (_capacity != _count) {
		@try {
			_items = of_realloc(_items, _count, _itemSize);
			_capacity = _count;
		} @catch (OFOutOfMemoryException *e) {
			/* We don't care, as we only made it smaller */
		}
	}

	object_setClass(self, [OFData class]);
}
@end