[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnustep-cvs] Fix NSCharacterSet caching bug
From: |
David Ayers |
Subject: |
Re: [Gnustep-cvs] Fix NSCharacterSet caching bug |
Date: |
Sat, 01 Nov 2003 11:25:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 |
Richard Frith-Macdonald wrote:
*+* * Source/NSCharacterSet.m
*+* ([NSCharacterSet _bitmapForSet:number:]): Restore caching while
*+* retaining the intended behavior of the previous change (is that
*+* intended behavior correct?).
*+* Perhaps should maintain a separate cache for each subclass ...
*+* or should that be the responsibility of the subclass itsself?
Actually my intent was *not* to retain a cache for subclasses
(especially mutable sets). If I want mutable set, then I generally mean
to alter it (like inverting itn). If the next caller get's the altered
cached object, he's not getting what he asks for. We can only cache
immutable versions, and then each subclass must do it's own caching.
(Maybe I should have added a comment.) But I'll add an extra test.
Yet (except for the caching) I'm not sure what the real change is.
Instead of:
if ([self isSubclassOfClass: [NSCharacterSet class]])
we now have
if (self != abstract && self != [set class])
where the [set class] is always initialized by:
set = [NSCharacterSet characterSetWithBitmapRepresentation: data];
Yet if it's not the same class but it invokes this implementation must'n it be
the a subclass?
So in that sense, your change didn't alter the behavior.
Cheers,
David
- Re: [Gnustep-cvs] Fix NSCharacterSet caching bug,
David Ayers <=