ObjFW  Diff

Differences From Artifact [b0dfbc26ff]:

To Artifact [3a75bc9f84]:


504
505
506
507
508
509
510
511

512
513

514
515
516

517
518

519
520
521
522
523
524
525
504
505
506
507
508
509
510

511
512

513
514
515

516
517

518
519
520
521
522
523
524
525







-
+

-
+


-
+

-
+







			return false;

	return true;
}

- (unsigned long)hash
{
	uint32_t hash;
	unsigned long hash;

	OF_HASH_INIT(hash);
	OFHashInit(&hash);

	for (id object in self)
		OF_HASH_ADD_HASH(hash, [object hash]);
		OFHashAddHash(&hash, [object hash]);

	OF_HASH_FINALIZE(hash);
	OFHashFinalize(&hash);

	return hash;
}

- (OFString *)description
{
	void *pool;
654
655
656
657
658
659
660
661

662
663
664
665
666
667

668
669
670
671
672
673
674
654
655
656
657
658
659
660

661
662
663
664
665
666

667
668
669
670
671
672
673
674







-
+





-
+







	count = self.count;

	if (count <= 15) {
		uint8_t tmp = 0x90 | ((uint8_t)count & 0xF);
		[data addItem: &tmp];
	} else if (count <= UINT16_MAX) {
		uint8_t type = 0xDC;
		uint16_t tmp = OF_BSWAP16_IF_LE((uint16_t)count);
		uint16_t tmp = OFToBigEndian16((uint16_t)count);

		[data addItem: &type];
		[data addItems: &tmp count: sizeof(tmp)];
	} else if (count <= UINT32_MAX) {
		uint8_t type = 0xDD;
		uint32_t tmp = OF_BSWAP32_IF_LE((uint32_t)count);
		uint32_t tmp = OFToBigEndian32((uint32_t)count);

		[data addItem: &type];
		[data addItems: &tmp count: sizeof(tmp)];
	} else
		@throw [OFOutOfRangeException exception];

	pool = objc_autoreleasePoolPush();