From df867c1495f92c0df046199557cab647a2f48170 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 13 Jan 2009 19:25:00 +0100 Subject: MLKDictionary: Implement required methods. --- MLKCons.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'MLKCons.m') diff --git a/MLKCons.m b/MLKCons.m index 2ab5a8b..07c8739 100644 --- a/MLKCons.m +++ b/MLKCons.m @@ -177,12 +177,18 @@ -(BOOL) isEqual:(id)object { if ([object isKindOfClass:[MLKCons class]]) - return ([((MLKCons*)object)->_car isEqual:_car] - && [((MLKCons*)object)->_cdr isEqual:_cdr]); + return ([nullify(((MLKCons*)object)->_car) isEqual:_car] + && [nullify(((MLKCons*)object)->_cdr) isEqual:_cdr]); else return NO; } +-(unsigned int) hash +{ + // FIXME: Well... + return [nullify(_car) hash]/2 + [nullify(_cdr) hash]/2; +} + -(id) copyWithZone:(NSZone *)zone { MLKCons *copy = [MLKCons allocWithZone:zone]; -- cgit v1.2.3