mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 03:01:27 +00:00
* GSWKeyValueAssociation
added _isValueSettable added _setValueNoValidation: inComponent: * GSWRepetition.m use private _setValueNoValidation: inComponent: to speed things up git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@25651 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c73ec0db7a
commit
afd8540a8d
4 changed files with 33 additions and 20 deletions
|
@ -3,6 +3,11 @@
|
|||
* GSWBindingNameAssociation.m
|
||||
* GSWAssociation.m
|
||||
add _setValueNoValidation:inComponent:
|
||||
* GSWKeyValueAssociation
|
||||
added _isValueSettable
|
||||
added _setValueNoValidation: inComponent:
|
||||
* GSWRepetition.m
|
||||
use private _setValueNoValidation: inComponent: to speed things up
|
||||
|
||||
2007-11-25 David Wetzel <dave@turbocat.de>
|
||||
* GSWAdaptors/Apache2/mod_gsw.c
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
@interface GSWKeyValueAssociation : GSWAssociation
|
||||
{
|
||||
NSString* _keyPath;
|
||||
BOOL _isValueSettable;
|
||||
}
|
||||
|
||||
-(id)initWithKeyPath:(NSString*)aKeyPath;
|
||||
|
|
|
@ -39,13 +39,13 @@ RCS_ID("$Id$")
|
|||
//--------------------------------------------------------------------
|
||||
-(id)initWithKeyPath:(NSString*)aKeyPath
|
||||
{
|
||||
//OK
|
||||
if ((self=[super init]))
|
||||
{
|
||||
ASSIGNCOPY(_keyPath,aKeyPath);
|
||||
};
|
||||
if ((self=[super init])) {
|
||||
ASSIGNCOPY(_keyPath,aKeyPath);
|
||||
_isValueSettable = ((_keyPath != nil) && ([_keyPath length] > 0));
|
||||
|
||||
}
|
||||
return self;
|
||||
};
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(void)dealloc
|
||||
|
@ -109,6 +109,13 @@ RCS_ID("$Id$")
|
|||
}
|
||||
}
|
||||
|
||||
- (void) _setValueNoValidation:(id) aValue inComponent:(GSWComponent*) component
|
||||
{
|
||||
if (_isValueSettable) {
|
||||
[component takeValue:aValue forKeyPath:_keyPath];
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(BOOL)isValueConstant
|
||||
{
|
||||
|
@ -118,8 +125,8 @@ RCS_ID("$Id$")
|
|||
//--------------------------------------------------------------------
|
||||
-(BOOL)isValueSettable
|
||||
{
|
||||
return YES;
|
||||
};
|
||||
return _isValueSettable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)description
|
||||
|
|
|
@ -136,12 +136,12 @@ static inline void _prepareForIterationWithIndex(int i, int j, NSArray * array,
|
|||
{
|
||||
if (item != nil) {
|
||||
id obj = [array objectAtIndex:i];
|
||||
[item setValue:obj
|
||||
inComponent:component]; // _setValueNoValidation?
|
||||
[item _setValueNoValidation:obj
|
||||
inComponent:component];
|
||||
}
|
||||
if (index != nil) {
|
||||
[index setValue:[NSNumber numberWithInt:i]
|
||||
inComponent:component]; // _setValueNoValidation?
|
||||
[index _setValueNoValidation:[NSNumber numberWithInt:i]
|
||||
inComponent:component];
|
||||
}
|
||||
if (i != 0) {
|
||||
[context incrementLastElementIDComponent];
|
||||
|
@ -154,12 +154,12 @@ static inline void _cleanupAfterIteration(GSWContext * context,
|
|||
GSWComponent * component, int i, GSWAssociation* item, GSWAssociation* index)
|
||||
{
|
||||
if (item != nil) {
|
||||
[item setValue:nil
|
||||
inComponent:component]; // _setValueNoValidation?
|
||||
[item _setValueNoValidation:nil
|
||||
inComponent:component];
|
||||
}
|
||||
if (index != nil) {
|
||||
[index setValue:[NSNumber numberWithInt:i]
|
||||
inComponent:component]; // _setValueNoValidation?
|
||||
[index _setValueNoValidation:[NSNumber numberWithInt:i]
|
||||
inComponent:component];
|
||||
}
|
||||
[context deleteLastElementIDComponent];
|
||||
}
|
||||
|
@ -255,14 +255,14 @@ static inline NSString* _indexStringForSenderAndElement(NSString * senderStr, NS
|
|||
currentValue = [arrayValue objectAtIndex:i];
|
||||
}
|
||||
if (_item != nil) {
|
||||
[_item setValue:currentValue
|
||||
inComponent:component]; // speedup? ?
|
||||
[_item _setValueNoValidation:currentValue
|
||||
inComponent:component];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_index != nil) {
|
||||
[_index setValue:[NSNumber numberWithInt:i]
|
||||
inComponent:component]; // speedup? ?
|
||||
[_index _setValueNoValidation:[NSNumber numberWithInt:i]
|
||||
inComponent:component];
|
||||
}
|
||||
[context appendElementIDComponent: indexStr];
|
||||
element = [super invokeActionForRequest:request
|
||||
|
|
Loading…
Reference in a new issue