Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -13,10 +13,11 @@ #include #import "OFArray.h" #import "OFExceptions.h" +#import "OFMacros.h" @implementation OFArray + array { return [[[self alloc] init] autorelease]; @@ -230,11 +231,27 @@ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -/* FIXME: Implement! - (uint32_t)hash { + OFObject **carray = [array cArray]; + size_t i, count = [array count]; + uint32_t hash; + + OF_HASH_INIT(hash); + + for (i = 0; i < count; i++) { + uint32_t h = [carray[i] hash]; + + OF_HASH_ADD(hash, h >> 24); + OF_HASH_ADD(hash, (h >> 16) & 0xFF); + OF_HASH_ADD(hash, (h >> 8) & 0xFF); + OF_HASH_ADD(hash, h & 0xFF); + } + + OF_HASH_FINALIZE(hash); + + return hash; } -*/ @end Index: src/OFMutableString.m ================================================================== --- src/OFMutableString.m +++ src/OFMutableString.m @@ -45,15 +45,13 @@ if (!is_utf8) { uint8_t *p = (uint8_t*)*string + *length; uint8_t t; - while (--p >= (uint8_t*)*string) { - t = table[0][*p]; - if (t != 0) + while (--p >= (uint8_t*)*string) + if ((t = table[0][*p]) != 0) *p = t; - } return; } ulen = [self length];