mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 10:01:14 +00:00
Improve performance by handing out proxy to internal string
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12418 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e931b93591
commit
d20683b862
3 changed files with 11 additions and 1 deletions
|
@ -3,6 +3,10 @@
|
|||
* Source/NSWindow.m: ([-sendEvent:]) handle mouse down in window if
|
||||
no view accepts it. ([-mouseDown:]) implement to quietly ignore
|
||||
event.
|
||||
* Source/GSTextStorage.h: additional ivar
|
||||
* Source/GSTextStorage.m: hand out a proxy to our internal storage,
|
||||
to avoid either copying it (inefficient) or exposing the mutable
|
||||
string (unsafe).
|
||||
|
||||
Wed Feb 6 02:30:09 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
{
|
||||
NSMutableString *_textChars;
|
||||
NSMutableArray *_infoArray;
|
||||
NSString *_textProxy;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -504,7 +504,11 @@ _attributesAtIndexEffectiveRange(
|
|||
|
||||
- (NSString*) string
|
||||
{
|
||||
return AUTORELEASE([_textChars copyWithZone: NSDefaultMallocZone()]);
|
||||
if (_textProxy == nil)
|
||||
{
|
||||
_textProxy = RETAIN([_textChars immutableProxy]);
|
||||
}
|
||||
return _textProxy;
|
||||
}
|
||||
|
||||
- (NSDictionary*) attributesAtIndex: (unsigned)index
|
||||
|
@ -777,6 +781,7 @@ changeInLength: [aString length] - range.length];
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
TEST_RELEASE(_textProxy);
|
||||
RELEASE(_textChars);
|
||||
RELEASE(_infoArray);
|
||||
[super dealloc];
|
||||
|
|
Loading…
Reference in a new issue