From ce0aadfcf7c32d811f29df9a711ea7ceda6a6b7c Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Fri, 22 Feb 2013 23:29:17 -0500 Subject: [PATCH] Optimizations No need to copy result of [self bounds], it's already a copy --- AppKit/CPBox.j | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AppKit/CPBox.j b/AppKit/CPBox.j index c3f39b0f6..06696c1da 100644 --- a/AppKit/CPBox.j +++ b/AppKit/CPBox.j @@ -436,16 +436,16 @@ CPBelowBottom = 6; - (void)drawRect:(CGRect)rect { - var bounds = CGRectMakeCopy([self bounds]); + var bounds = [self bounds]; switch (_boxType) { case CPBoxSeparator: // NSBox does not include a horizontal flag for the separator type. We have to determine // the type of separator to draw by the width and height of the frame. - if (CGRectGetWidth(bounds) === 5.0) + if (_CGRectGetWidth(bounds) === 5.0) return [self _drawVerticalSeparatorInRect:bounds]; - else if (CGRectGetHeight(bounds) === 5.0) + else if (_CGRectGetHeight(bounds) === 5.0) return [self _drawHorizontalSeparatorInRect:bounds]; break; @@ -492,8 +492,8 @@ CPBelowBottom = 6; CGContextSetStrokeColor(context, [self borderColor]); CGContextSetLineWidth(context, 1.0); - CGContextMoveToPoint(context, CGRectGetMinX(aRect), CGRectGetMidY(aRect)); - CGContextAddLineToPoint(context, CGRectGetWidth(aRect), CGRectGetMidY(aRect)); + CGContextMoveToPoint(context, _CGRectGetMinX(aRect), _CGRectGetMidY(aRect)); + CGContextAddLineToPoint(context, _CGRectGetWidth(aRect), _CGRectGetMidY(aRect)); CGContextStrokePath(context); } @@ -504,8 +504,8 @@ CPBelowBottom = 6; CGContextSetStrokeColor(context, [self borderColor]); CGContextSetLineWidth(context, 1.0); - CGContextMoveToPoint(context, CGRectGetMidX(aRect), CGRectGetMinY(aRect)); - CGContextAddLineToPoint(context, CGRectGetMidX(aRect), CGRectGetHeight(aRect)); + CGContextMoveToPoint(context, _CGRectGetMidX(aRect), _CGRectGetMinY(aRect)); + CGContextAddLineToPoint(context, _CGRectGetMidX(aRect), _CGRectGetHeight(aRect)); CGContextStrokePath(context); }