Index: src/OFMutableDictionary.h ================================================================== --- src/OFMutableDictionary.h +++ src/OFMutableDictionary.h @@ -12,11 +12,15 @@ #import "OFDictionary.h" /** * The OFMutableDictionary class is a class for using mutable hash tables. */ -@interface OFMutableDictionary: OFDictionary {} +@interface OFMutableDictionary: OFDictionary +{ + unsigned long mutations; +} + /** * Sets a key to an object. A key can be any object. * * \param key The key to set * \param obj The object to set the key to Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -87,10 +87,12 @@ ![data[i].key isEqual: key]; i++); /* Key not in dictionary */ if (i >= size || ![data[i].key isEqual: key]) { resize(self, isa, count + 1, &data, &size); + + mutations++; i = hash & (size - 1); for (; i < size && data[i].key != nil; i++); /* In case the last bucket is already used */ @@ -150,10 +152,11 @@ [data[i].key release]; [data[i].object release]; data[i].key = nil; count--; + mutations++; resize(self, isa, count, &data, &size); return self; }