Add a space between the ? and : in ternarys

This commit is contained in:
Eric Jensen
2016-03-17 10:38:51 -07:00
parent 14a389c5e0
commit 17aebcbaba
11 changed files with 17 additions and 17 deletions

View File

@@ -271,8 +271,8 @@
- (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state - (void)setTitle:(NSString *)title withFont:(UIFont *)font withColor:(UIColor *)color forState:(ASControlState)state
{ {
NSDictionary *attributes = @{ NSDictionary *attributes = @{
NSFontAttributeName: font ?: [UIFont systemFontOfSize:[UIFont buttonFontSize]], NSFontAttributeName: font ? : [UIFont systemFontOfSize:[UIFont buttonFontSize]],
NSForegroundColorAttributeName : color ?: [UIColor blackColor] NSForegroundColorAttributeName : color ? : [UIColor blackColor]
}; };
NSAttributedString *string = [[NSAttributedString alloc] initWithString:title NSAttributedString *string = [[NSAttributedString alloc] initWithString:title

View File

@@ -768,7 +768,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
- (BOOL)usesImplicitHierarchyManagement - (BOOL)usesImplicitHierarchyManagement
{ {
ASDN::MutexLocker l(_propertyLock); ASDN::MutexLocker l(_propertyLock);
return _usesImplicitHierarchyManagement ?: [[self class] usesImplicitHierarchyManagement]; return _usesImplicitHierarchyManagement ? : [[self class] usesImplicitHierarchyManagement];
} }
- (void)setUsesImplicitHierarchyManagement:(BOOL)value - (void)setUsesImplicitHierarchyManagement:(BOOL)value
@@ -1062,7 +1062,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo
{ {
ASDisplayNodeAssertThreadAffinity(self); ASDisplayNodeAssertThreadAffinity(self);
// Get root node of the accessible node hierarchy, if node not specified // Get root node of the accessible node hierarchy, if node not specified
node = node ?: ASDisplayNodeUltimateParentOfNode(self); node = node ? : ASDisplayNodeUltimateParentOfNode(self);
// Calculate transform to map points between coordinate spaces // Calculate transform to map points between coordinate spaces
CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self); CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self);
@@ -1077,7 +1077,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo
{ {
ASDisplayNodeAssertThreadAffinity(self); ASDisplayNodeAssertThreadAffinity(self);
// Get root node of the accessible node hierarchy, if node not specified // Get root node of the accessible node hierarchy, if node not specified
node = node ?: ASDisplayNodeUltimateParentOfNode(self); node = node ? : ASDisplayNodeUltimateParentOfNode(self);
// Calculate transform to map points between coordinate spaces // Calculate transform to map points between coordinate spaces
CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node); CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node);
@@ -1092,7 +1092,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo
{ {
ASDisplayNodeAssertThreadAffinity(self); ASDisplayNodeAssertThreadAffinity(self);
// Get root node of the accessible node hierarchy, if node not specified // Get root node of the accessible node hierarchy, if node not specified
node = node ?: ASDisplayNodeUltimateParentOfNode(self); node = node ? : ASDisplayNodeUltimateParentOfNode(self);
// Calculate transform to map points between coordinate spaces // Calculate transform to map points between coordinate spaces
CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self); CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(node, self);
@@ -1107,7 +1107,7 @@ static inline CATransform3D _calculateTransformFromReferenceToTarget(ASDisplayNo
{ {
ASDisplayNodeAssertThreadAffinity(self); ASDisplayNodeAssertThreadAffinity(self);
// Get root node of the accessible node hierarchy, if node not specified // Get root node of the accessible node hierarchy, if node not specified
node = node ?: ASDisplayNodeUltimateParentOfNode(self); node = node ? : ASDisplayNodeUltimateParentOfNode(self);
// Calculate transform to map points between coordinate spaces // Calculate transform to map points between coordinate spaces
CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node); CATransform3D nodeTransform = _calculateTransformFromReferenceToTarget(self, node);

View File

@@ -309,7 +309,7 @@
if (ASObjectIsEqual(_placeholderTextKitComponents.textStorage, attributedPlaceholderText)) if (ASObjectIsEqual(_placeholderTextKitComponents.textStorage, attributedPlaceholderText))
return; return;
[_placeholderTextKitComponents.textStorage setAttributedString:attributedPlaceholderText ?: [[NSAttributedString alloc] initWithString:@""]]; [_placeholderTextKitComponents.textStorage setAttributedString:attributedPlaceholderText ? : [[NSAttributedString alloc] initWithString:@""]];
_textKitComponents.textView.accessibilityHint = attributedPlaceholderText.string; _textKitComponents.textView.accessibilityHint = attributedPlaceholderText.string;
} }
@@ -332,7 +332,7 @@
// If we (_cmd) are called while the text view itself is updating (-textViewDidUpdate:), you cannot update the text storage and expect perfect propagation to the text view. // If we (_cmd) are called while the text view itself is updating (-textViewDidUpdate:), you cannot update the text storage and expect perfect propagation to the text view.
// Thus, we always update the textview directly if it's been created already. // Thus, we always update the textview directly if it's been created already.
if (ASObjectIsEqual((_textKitComponents.textView.attributedText ?: _textKitComponents.textStorage), attributedText)) if (ASObjectIsEqual((_textKitComponents.textView.attributedText ? : _textKitComponents.textStorage), attributedText))
return; return;
// If the cursor isn't at the end of the text, we need to preserve the selected range to avoid moving the cursor. // If the cursor isn't at the end of the text, we need to preserve the selected range to avoid moving the cursor.

View File

@@ -260,7 +260,7 @@
- (void)setAnnotations:(NSArray *)annotations - (void)setAnnotations:(NSArray *)annotations
{ {
annotations = [annotations copy] ?: @[]; annotations = [annotations copy] ? : @[];
ASDN::MutexLocker l(_propertyLock); ASDN::MutexLocker l(_propertyLock);
_annotations = annotations; _annotations = annotations;

View File

@@ -700,7 +700,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
options.synchronous = YES; options.synchronous = YES;
} }
PHImageManager *imageManager = strongSelf.imageManager ?: PHImageManager.defaultManager; PHImageManager *imageManager = strongSelf.imageManager ? : PHImageManager.defaultManager;
[imageManager requestImageForAsset:imageAsset targetSize:request.targetSize contentMode:request.contentMode options:options resultHandler:^(UIImage *image, NSDictionary *info) { [imageManager requestImageForAsset:imageAsset targetSize:request.targetSize contentMode:request.contentMode options:options resultHandler:^(UIImage *image, NSDictionary *info) {
NSError *error = info[PHImageErrorKey]; NSError *error = info[PHImageErrorKey];

View File

@@ -503,7 +503,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
CGFloat dir = (inserting) ? +1 : -1; CGFloat dir = (inserting) ? +1 : -1;
CGFloat adjustment = 0; CGFloat adjustment = 0;
NSIndexPath *top = _contentOffsetAdjustmentTopVisibleRow ?: self.indexPathsForVisibleRows.firstObject; NSIndexPath *top = _contentOffsetAdjustmentTopVisibleRow ? : self.indexPathsForVisibleRows.firstObject;
for (int index = 0; index < indexPaths.count; index++) { for (int index = 0; index < indexPaths.count; index++) {
NSIndexPath *indexPath = indexPaths[index]; NSIndexPath *indexPath = indexPaths[index];

View File

@@ -631,7 +631,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ];
CABasicAnimation *fadeOut = [CABasicAnimation animationWithKeyPath:@"opacity"]; CABasicAnimation *fadeOut = [CABasicAnimation animationWithKeyPath:@"opacity"];
fadeOut.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; fadeOut.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
fadeOut.fromValue = possibleFadeIn.toValue ?: @(((CALayer *)weakHighlightLayer.presentationLayer).opacity); fadeOut.fromValue = possibleFadeIn.toValue ? : @(((CALayer *)weakHighlightLayer.presentationLayer).opacity);
fadeOut.toValue = @0.0; fadeOut.toValue = @0.0;
fadeOut.fillMode = kCAFillModeBoth; fadeOut.fillMode = kCAFillModeBoth;
fadeOut.duration = ASTextNodeHighlightFadeOutDuration; fadeOut.duration = ASTextNodeHighlightFadeOutDuration;

View File

@@ -240,7 +240,7 @@ static const char *kContextKey = NSStringFromClass(ASBasicImageDownloaderContext
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// associate metadata with it // associate metadata with it
NSMutableDictionary *callbackData = [NSMutableDictionary dictionary]; NSMutableDictionary *callbackData = [NSMutableDictionary dictionary];
callbackData[kASBasicImageDownloaderContextCallbackQueue] = callbackQueue ?: dispatch_get_main_queue(); callbackData[kASBasicImageDownloaderContextCallbackQueue] = callbackQueue ? : dispatch_get_main_queue();
if (downloadProgressBlock) { if (downloadProgressBlock) {
callbackData[kASBasicImageDownloaderContextProgressBlock] = [downloadProgressBlock copy]; callbackData[kASBasicImageDownloaderContextProgressBlock] = [downloadProgressBlock copy];

View File

@@ -967,7 +967,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
- (NSArray *)completedNodes - (NSArray *)completedNodes
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();
return _externalCompletedNodes ?: _completedNodes[ASDataControllerRowNodeKind]; return _externalCompletedNodes ? : _completedNodes[ASDataControllerRowNodeKind];
} }
#pragma mark - Dealloc #pragma mark - Dealloc

View File

@@ -110,7 +110,7 @@ extern BOOL CGPointIsNull(CGPoint point)
for (ASLayout *sublayout in context.layout.sublayouts) { for (ASLayout *sublayout in context.layout.sublayouts) {
// Mark layout trees that have already been flattened for future identification of immediate sublayouts // Mark layout trees that have already been flattened for future identification of immediate sublayouts
BOOL flattened = context.flattened ?: context.layout.flattened; BOOL flattened = context.flattened ? : context.layout.flattened;
queue.push({sublayout, context.absolutePosition + sublayout.position, NO, flattened}); queue.push({sublayout, context.absolutePosition + sublayout.position, NO, flattened});
} }
} }

View File

@@ -370,7 +370,7 @@ static void __ASDisplayLayerDecrementConcurrentDisplayCount(BOOL displayIsAsync,
// while synchronizing the final application of the results to the layer's contents property (completionBlock). // while synchronizing the final application of the results to the layer's contents property (completionBlock).
// First, look to see if we are expected to join a parent's transaction container. // First, look to see if we are expected to join a parent's transaction container.
CALayer *containerLayer = _layer.asyncdisplaykit_parentTransactionContainer ?: _layer; CALayer *containerLayer = _layer.asyncdisplaykit_parentTransactionContainer ? : _layer;
// In the case that a transaction does not yet exist (such as for an individual node outside of a container), // In the case that a transaction does not yet exist (such as for an individual node outside of a container),
// this call will allocate the transaction and add it to _ASAsyncTransactionGroup. // this call will allocate the transaction and add it to _ASAsyncTransactionGroup.