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.