Minor performance improvement to CPContinuouslyUpdatesValueBindingOption.

This commit is contained in:
Alexander Ljungberg
2011-03-28 20:12:32 -04:00
parent f9f03c8b54
commit 11ab9a77ad
2 changed files with 13 additions and 5 deletions
+12
View File
@@ -149,6 +149,18 @@ var CPControlBlackColor = [CPColor blackColor];
return [super _binderClassForBinding:theBinding];
}
/*!
Reverse set the binding iff the CPContinuouslyUpdatesValueBindingOption is set.
*/
- (void)_continuouslyReverseSetBinding
{
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
theBinding = [binderClass getBinding:CPValueBinding forObject:self];
if ([theBinding continuouslyUpdatesValue])
[theBinding reverseSetValueFor:@"objectValue"];
}
- (void)_reverseSetBinding
{
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
+1 -5
View File
@@ -808,11 +808,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if ([note object] !== self)
return;
var binderClass = [[self class] _binderClassForBinding:CPValueBinding],
theBinding = [binderClass getBinding:CPValueBinding forObject:self];
if ([theBinding continuouslyUpdatesValue])
[self _reverseSetBinding];
[self _continuouslyReverseSetBinding];
[super textDidChange:note];
}