787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
|
if (string.UTF8StringLength != _s->cStringLength ||
string.length != _s->length)
return false;
if (([string isKindOfClass: [OFUTF8String class]] ||
[string isKindOfClass: [OFMutableUTF8String class]]) &&
_s->hashed && string->_s->hashed && _s->hash != string->_s->hash)
return false;
if (strcmp(_s->cString, string.UTF8String) != 0)
return false;
return true;
}
|
|
|
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
|
if (string.UTF8StringLength != _s->cStringLength ||
string.length != _s->length)
return false;
if (([string isKindOfClass: [OFUTF8String class]] ||
[string isKindOfClass: [OFMutableUTF8String class]]) &&
_s->hasHash && string->_s->hasHash && _s->hash != string->_s->hash)
return false;
if (strcmp(_s->cString, string.UTF8String) != 0)
return false;
return true;
}
|
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
|
return OFOrderedSame;
}
- (unsigned long)hash
{
unsigned long hash;
if (_s->hashed)
return _s->hash;
OFHashInit(&hash);
for (size_t i = 0; i < _s->cStringLength; i++) {
OFUnichar c;
ssize_t length;
|
|
|
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
|
return OFOrderedSame;
}
- (unsigned long)hash
{
unsigned long hash;
if (_s->hasHash)
return _s->hash;
OFHashInit(&hash);
for (size_t i = 0; i < _s->cStringLength; i++) {
OFUnichar c;
ssize_t length;
|
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
i += length - 1;
}
OFHashFinalize(&hash);
_s->hash = hash;
_s->hashed = true;
return hash;
}
- (OFUnichar)characterAtIndex: (size_t)idx
{
OFUnichar character;
|
|
|
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
|
i += length - 1;
}
OFHashFinalize(&hash);
_s->hash = hash;
_s->hasHash = true;
return hash;
}
- (OFUnichar)characterAtIndex: (size_t)idx
{
OFUnichar character;
|