ObjFW  Diff

Differences From Artifact [d81f7e695a]:

To Artifact [c3f91002a4]:


558
559
560
561
562
563
564
565
566


567
568
569
570







571













572
573
574
575
576
577
578
}

- (id)mutableCopy
{
	return [[OFMutableString alloc] initWithString: self];
}

- (int)compare: (id)obj
{


	if (![obj isKindOfClass: [OFString class]])
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];








	return strcmp(string, [obj cString]);













}

- (uint32_t)hash
{
	uint32_t hash;
	size_t i;








|

>
>
|



>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>







558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
}

- (id)mutableCopy
{
	return [[OFMutableString alloc] initWithString: self];
}

- (of_comparison_result_t)compare: (OFString*)str
{
	int cmp;

	if (![str isKindOfClass: [OFString class]])
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	if ([str length] == [self length]) {
		if (length != [str cStringLength]) {
			if (length > [str cStringLength])
				return OF_ORDERED_DESCENDING;
			else
				return OF_ORDERED_ASCENDING;
		}

		if ((cmp = memcmp(string, [str cString], length)) == 0)
			return OF_ORDERED_SAME;

		if (cmp > 0)
			return OF_ORDERED_DESCENDING;
		else
			return OF_ORDERED_ASCENDING;
	}

	if ([self length] > [str length])
		return OF_ORDERED_DESCENDING;
	else
		return OF_ORDERED_ASCENDING;
}

- (uint32_t)hash
{
	uint32_t hash;
	size_t i;