Minor optimisation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5571 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-12-18 05:41:21 +00:00
parent f64cf8af3a
commit 64b06a9b4f
2 changed files with 7 additions and 10 deletions

View file

@ -1,3 +1,8 @@
Sat Dec 18 5:38:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* Source/NSView.m: ([-initWithCoder:]) small optimisation and
consistency check when decoding and adding subviews.
Fri Dec 17 23:44:53 1999 Nicola Pero <n.pero@mi.flashnet.it>
* Headers/AppKit/NSBox.h: Prefixed ivars with underscores.

View file

@ -2504,15 +2504,8 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
e = [subs objectEnumerator];
while ((sub = [e nextObject]) != nil)
{
// We can't use [self addSubview: sub]; because NSBox overrides
// that method: we need to take the long way.
if ([self isDescendantOf: sub])
{
NSLog(@"Operation addSubview: creates a loop in the views tree!\n");
continue;
}
RETAIN (sub);
[sub removeFromSuperview];
NSAssert(sub->window == nil, NSInternalInconsistencyException);
NSAssert(sub->super_view == nil, NSInternalInconsistencyException);
[sub viewWillMoveToWindow: window];
[sub viewWillMoveToSuperview: self];
[sub setNextResponder: self];
@ -2520,7 +2513,6 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
_rFlags.has_subviews = 1;
[sub resetCursorRects];
[sub setNeedsDisplay: YES];
RELEASE(sub);
}
RELEASE(subs);