From 1457e97c590de26b3a786f0848c9e89449983dcc Mon Sep 17 00:00:00 2001 From: Tom King Date: Tue, 8 Mar 2016 08:54:07 -0500 Subject: [PATCH] create local variables for performance and clarity --- AsyncDisplayKit/ASTextNode.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AsyncDisplayKit/ASTextNode.mm b/AsyncDisplayKit/ASTextNode.mm index d94a0f8b4e..dd83467326 100644 --- a/AsyncDisplayKit/ASTextNode.mm +++ b/AsyncDisplayKit/ASTextNode.mm @@ -891,15 +891,16 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; { [super touchesMoved:touches withEvent:event]; + UITouch *touch = [touches anyObject]; + CGPoint locationInView = [touch locationInView:self.view]; // on 3D Touch enabled phones, this gets fired with changes in force, and usually will get fired immediately after touchesBegan:withEvent: - if (CGPointEqualToPoint([[touches anyObject] previousLocationInView:self.view], [[touches anyObject] locationInView:self.view])) + if (CGPointEqualToPoint([touch previousLocationInView:self.view], locationInView)) return; // If touch has moved out of the current highlight range, clear the highlight. if (_highlightRange.length > 0) { NSRange range = NSMakeRange(0, 0); - CGPoint point = [[touches anyObject] locationInView:self.view]; - [self _linkAttributeValueAtPoint:point + [self _linkAttributeValueAtPoint:locationInView attributeName:NULL range:&range inAdditionalTruncationMessage:NULL