diff --git a/Foundation/CPPredicate/_CPBlockExpression.j b/Foundation/CPPredicate/_CPBlockExpression.j index 299f250ee..6b91b3967 100644 --- a/Foundation/CPPredicate/_CPBlockExpression.j +++ b/Foundation/CPPredicate/_CPBlockExpression.j @@ -53,11 +53,9 @@ - (id)expressionValueWithObject:(id)object context:(CPDictionary)context { - var args = []; - - [_arguments enumerateObjectsUsingBlock:function(exp, idx) + var args = [_arguments arrayByApplyingBlock:function(exp, _) { - [args addObject:[exp expressionValueWithObject:object context:context]]; + return [exp expressionValueWithObject:object context:context]; }]; return _block(object, args, context); @@ -65,11 +63,9 @@ - (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)bindings { - var args = []; - - [_arguments enumerateObjectsUsingBlock:function(exp, idx) + var args = [_arguments arrayByApplyingBlock:function(exp, _) { - [args addObject:[exp _expressionWithSubstitutionVariables:bindings]]; + return [exp _expressionWithSubstitutionVariables:bindings]; }]; return [[_CPBlockExpression alloc] initWithBlock:_block arguments:args];