From 65dee154f7fa2c04ad8ae3deeeedd88f804ff625 Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sat, 6 Feb 2016 20:39:49 +0100 Subject: [PATCH] Remove ignored argument _ --- AppKit/CPComboBox.j | 6 ++---- AppKit/CPGradient.j | 2 +- AppKit/CPGraphics.j | 2 +- AppKit/CPPopUpButton.j | 2 +- AppKit/CPThemeBlend.j | 2 +- AppKit/CPToolbar.j | 2 +- AppKit/Platform/DOM/CPPlatformWindow+DOM.j | 2 +- Foundation/CPAttributedString.j | 2 +- Foundation/CPBundle.j | 2 +- Foundation/CPIndexSet.j | 2 +- Foundation/CPKeyedArchiver.j | 2 +- Foundation/CPPredicate/_CPAggregateExpression.j | 6 +++--- Foundation/CPPredicate/_CPBlockExpression.j | 4 ++-- Foundation/CPPredicate/_CPFunctionExpression.j | 2 +- 14 files changed, 18 insertions(+), 20 deletions(-) diff --git a/AppKit/CPComboBox.j b/AppKit/CPComboBox.j index b5aa1b7c2..61a159ed7 100644 --- a/AppKit/CPComboBox.j +++ b/AppKit/CPComboBox.j @@ -1142,11 +1142,9 @@ var CPComboBoxTextSubview = @"text", // Directly nuke _items, [_items removeAll] will trigger an extra call to setContent _items = []; - var values = []; - - [anArray enumerateObjectsUsingBlock:function(object) + var values = [anArray arrayByApplyingBlock:function(object) { - values.push([object description]); + return [object description]; }]; [self addItemsWithObjectValues:values]; diff --git a/AppKit/CPGradient.j b/AppKit/CPGradient.j index 126e43995..93b08b2d2 100644 --- a/AppKit/CPGradient.j +++ b/AppKit/CPGradient.j @@ -71,7 +71,7 @@ CPGradientDrawsAfterEndingLocation = kCGGradientDrawsAfterEndLocation; if (self = [super init]) { var colorSpace = [aColorSpace CGColorSpace] || CGColorSpaceCreateDeviceRGB, - cgColors = [someColors arrayByApplyingBlock:function(color, _) + cgColors = [someColors arrayByApplyingBlock:function(color) { return CGColorCreate(colorSpace, [color components]) }]; diff --git a/AppKit/CPGraphics.j b/AppKit/CPGraphics.j index 207e05c8c..55dbb9f73 100644 --- a/AppKit/CPGraphics.j +++ b/AppKit/CPGraphics.j @@ -43,7 +43,7 @@ function CPDrawTiledRects( if (sides.length != grays.length) [CPException raise:CPInvalidArgumentException reason:@"sides (length: " + sides.length + ") and grays (length: " + grays.length + ") must have the same length."]; - var colors = [grays arrayByApplyingBlock:function(gray, _) + var colors = [grays arrayByApplyingBlock:function(gray) { return [CPColor colorWithCalibratedWhite:gray alpha:1.0]; }]; diff --git a/AppKit/CPPopUpButton.j b/AppKit/CPPopUpButton.j index 77c6cda06..6eecf9420 100644 --- a/AppKit/CPPopUpButton.j +++ b/AppKit/CPPopUpButton.j @@ -361,7 +361,7 @@ CPPopUpButtonStatePullsDown = CPThemeState("pulls-down"); */ - (CPArray)itemTitles { - return [[self itemArray] arrayByApplyingBlock:function(item, _) + return [[self itemArray] arrayByApplyingBlock:function(item) { return [item title]; }]; diff --git a/AppKit/CPThemeBlend.j b/AppKit/CPThemeBlend.j index a34544841..78cceaac3 100644 --- a/AppKit/CPThemeBlend.j +++ b/AppKit/CPThemeBlend.j @@ -64,7 +64,7 @@ */ - (CPArray)themeNames { - return [_themes arrayByApplyingBlock:function(theme, _) + return [_themes arrayByApplyingBlock:function(theme) { return theme.substring(0, theme.indexOf(".keyedtheme")); }]; diff --git a/AppKit/CPToolbar.j b/AppKit/CPToolbar.j index 8954c7160..b62aa82d6 100644 --- a/AppKit/CPToolbar.j +++ b/AppKit/CPToolbar.j @@ -459,7 +459,7 @@ var CPToolbarsByIdentifier = nil, /* @ignore */ - (id)_itemsWithIdentifiers:(CPArray)identifiers { - return [identifiers arrayByApplyingBlock:function(identifier, _) + return [identifiers arrayByApplyingBlock:function(identifier) { return [self _itemForItemIdentifier:identifier willBeInsertedIntoToolbar:NO]; }]; diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 6d24c1985..fa54e8892 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -1859,7 +1859,7 @@ function CPWindowList() { var windowObjectList = CPWindowObjectList(); - return [windowObjectList arrayByApplyingBlock:function(windowObject, _) + return [windowObjectList arrayByApplyingBlock:function(windowObject) { return [windowObject windowNumber]; }]; diff --git a/Foundation/CPAttributedString.j b/Foundation/CPAttributedString.j index 7badf601e..3416b64bc 100755 --- a/Foundation/CPAttributedString.j +++ b/Foundation/CPAttributedString.j @@ -763,7 +763,7 @@ - (void)setAttributedString:(CPAttributedString)aString { _string = aString._string; - _rangeEntries = [aString._rangeEntries arrayByApplyingBlock:function(entry, _) + _rangeEntries = [aString._rangeEntries arrayByApplyingBlock:function(entry) { return copyRangeEntry(entry); }]; diff --git a/Foundation/CPBundle.j b/Foundation/CPBundle.j index 8c3ab2918..fa752574a 100644 --- a/Foundation/CPBundle.j +++ b/Foundation/CPBundle.j @@ -214,7 +214,7 @@ var CPBundlesForURLStrings = { }; { var staticResources = _bundle.staticResources(); - return [staticResources arrayByApplyingBlock:function(resource, _) + return [staticResources arrayByApplyingBlock:function(resource) { return resource.URL(); }]; diff --git a/Foundation/CPIndexSet.j b/Foundation/CPIndexSet.j index e23f4a451..1783caf27 100644 --- a/Foundation/CPIndexSet.j +++ b/Foundation/CPIndexSet.j @@ -1021,7 +1021,7 @@ var CPIndexSetCountKey = @"CPIndexSetCountKey", var rangeStrings = [aCoder decodeObjectForKey:CPIndexSetRangeStringsKey]; - _ranges = [rangeStrings arrayByApplyingBlock:function(range, _) + _ranges = [rangeStrings arrayByApplyingBlock:function(range) { return CPRangeFromString(range); }]; diff --git a/Foundation/CPKeyedArchiver.j b/Foundation/CPKeyedArchiver.j index 7c074c383..20bb7b4be 100644 --- a/Foundation/CPKeyedArchiver.j +++ b/Foundation/CPKeyedArchiver.j @@ -380,7 +380,7 @@ var _CPKeyedArchiverStringClass = Nil, /* @ignore */ - (void)_encodeArrayOfObjects:(CPArray)objects forKey:(CPString)aKey { - var references = [objects arrayByApplyingBlock:function(object, _) + var references = [objects arrayByApplyingBlock:function(object) { return _CPKeyedArchiverEncodeObject(self, object, NO); }]; diff --git a/Foundation/CPPredicate/_CPAggregateExpression.j b/Foundation/CPPredicate/_CPAggregateExpression.j index 40760c626..e141b1915 100644 --- a/Foundation/CPPredicate/_CPAggregateExpression.j +++ b/Foundation/CPPredicate/_CPAggregateExpression.j @@ -51,7 +51,7 @@ - (id)expressionValueWithObject:(id)object context:(CPDictionary)context { - return [_aggregate arrayByApplyingBlock:function(exp, _) + return [_aggregate arrayByApplyingBlock:function(exp) { return [exp expressionValueWithObject:object context:context]; }]; @@ -59,7 +59,7 @@ - (CPString)description { - var descriptions = [_aggregate arrayByApplyingBlock:function(exp, _) + var descriptions = [_aggregate arrayByApplyingBlock:function(exp) { return [exp description]; }]; @@ -69,7 +69,7 @@ - (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables { - var subst_array = [_aggregate arrayByApplyingBlock:function(exp, _) + var subst_array = [_aggregate arrayByApplyingBlock:function(exp) { return [exp _expressionWithSubstitutionVariables:variables]; }]; diff --git a/Foundation/CPPredicate/_CPBlockExpression.j b/Foundation/CPPredicate/_CPBlockExpression.j index 6b91b3967..846c4f418 100644 --- a/Foundation/CPPredicate/_CPBlockExpression.j +++ b/Foundation/CPPredicate/_CPBlockExpression.j @@ -53,7 +53,7 @@ - (id)expressionValueWithObject:(id)object context:(CPDictionary)context { - var args = [_arguments arrayByApplyingBlock:function(exp, _) + var args = [_arguments arrayByApplyingBlock:function(exp) { return [exp expressionValueWithObject:object context:context]; }]; @@ -63,7 +63,7 @@ - (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)bindings { - var args = [_arguments arrayByApplyingBlock:function(exp, _) + var args = [_arguments arrayByApplyingBlock:function(exp) { return [exp _expressionWithSubstitutionVariables:bindings]; }]; diff --git a/Foundation/CPPredicate/_CPFunctionExpression.j b/Foundation/CPPredicate/_CPFunctionExpression.j index 1630bc007..7de9f0d73 100644 --- a/Foundation/CPPredicate/_CPFunctionExpression.j +++ b/Foundation/CPPredicate/_CPFunctionExpression.j @@ -133,7 +133,7 @@ - (CPExpression)_expressionWithSubstitutionVariables:(CPDictionary)variables { var operand = [[self operand] _expressionWithSubstitutionVariables:variables], - args = [_arguments arrayByApplyingBlock:function(arg, _) + args = [_arguments arrayByApplyingBlock:function(arg) { return [arg _expressionWithSubstitutionVariables:variables]; }];