@@ -1034,10 +1034,13 @@ { OFAutoreleasePool *pool; OFString *otherString; const of_unichar_t *unicodeString, *otherUnicodeString; size_t length; + + if (object == self) + return YES; if (![object isKindOfClass: [OFString class]]) return NO; otherString = object; @@ -1077,10 +1080,13 @@ OFAutoreleasePool *pool; OFString *otherString; const of_unichar_t *unicodeString, *otherUnicodeString; size_t i, minimumLength; + if (object == self) + return OF_ORDERED_SAME; + if (![object isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exceptionWithClass: isa selector: _cmd]; otherString = object; @@ -1117,10 +1123,13 @@ - (of_comparison_result_t)caseInsensitiveCompare: (OFString*)otherString { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; const of_unichar_t *string, *otherUnicodeString; size_t i, length, otherLength, minimumLength; + + if (otherString == self) + return OF_ORDERED_SAME; string = [self unicodeString]; otherUnicodeString = [otherString unicodeString]; length = [self length]; otherLength = [otherString length];