From: Mitchell Livingston Date: Sun, 14 Oct 2012 17:33:23 +0000 (+0000) Subject: move a variable outside of a loop X-Git-Tag: 2.72~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2430bb060d60649baa9bc774f921790f5264c893;p=transmission move a variable outside of a loop --- diff --git a/macosx/InfoActivityViewController.m b/macosx/InfoActivityViewController.m index 876003494..2ec9f29b2 100644 --- a/macosx/InfoActivityViewController.m +++ b/macosx/InfoActivityViewController.m @@ -89,8 +89,8 @@ NSArray * fields = @[ fDateAddedField, fDateCompletedField, fDateActivityField, fStateField, fProgressField, fHaveField, fDownloadedTotalField, fUploadedTotalField, fFailedHashField, fRatioField, fDownloadTimeField, fSeedTimeField, fErrorScrollView ]; + const CGFloat widthIncrease = newMaxWidth - oldMaxWidth; for (NSView * field in fields) { - const CGFloat widthIncrease = newMaxWidth - oldMaxWidth; NSRect frame = [field frame]; frame.origin.x += widthIncrease; frame.size.width -= widthIncrease; diff --git a/macosx/InfoGeneralViewController.m b/macosx/InfoGeneralViewController.m index b920e8669..cc24ba6fb 100644 --- a/macosx/InfoGeneralViewController.m +++ b/macosx/InfoGeneralViewController.m @@ -84,8 +84,8 @@ NSArray * fields = @[ fPiecesField, fHashField, fSecureField, fCreatorField, fDateCreatedField, fCommentScrollView, fDataLocationField ]; + const CGFloat widthIncrease = newMaxWidth - oldMaxWidth; for (NSView * field in fields) { - const CGFloat widthIncrease = newMaxWidth - oldMaxWidth; NSRect frame = [field frame]; frame.origin.x += widthIncrease; frame.size.width -= widthIncrease; diff --git a/macosx/StatusBarView.m b/macosx/StatusBarView.m index e3d4a91ee..4342f70ff 100644 --- a/macosx/StatusBarView.m +++ b/macosx/StatusBarView.m @@ -42,7 +42,6 @@ NSColor * darkColor = [NSColor colorWithCalibratedRed: 155.0/255.0 green: 155.0/255.0 blue: 155.0/255.0 alpha: 1.0]; fGradient = [[NSGradient alloc] initWithStartingColor: lightColor endingColor: darkColor]; - //noise only for 10.7 + if([NSApp isOnLionOrBetter]) { CIFilter * randomFilter = [CIFilter filterWithName: @"CIRandomGenerator"];