From ff745e1a823b059c243aa39895e7160b69a7a0b6 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 30 Mar 2017 22:56:21 +0200 Subject: [PATCH] Use prefix increment in for loops. --- atom/browser/browser_mac.mm | 2 +- atom/browser/ui/cocoa/atom_touch_bar.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/browser/browser_mac.mm b/atom/browser/browser_mac.mm index f231d7a..1a15bc0 100644 --- a/atom/browser/browser_mac.mm +++ b/atom/browser/browser_mac.mm @@ -64,7 +64,7 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol, // On macOS, we can't query the default, but the handlers list seems to put // Apple's defaults first, so we'll use the first option that isn't our bundle CFStringRef other = nil; - for (CFIndex i = 0; i < CFArrayGetCount(bundleList); i++) { + for (CFIndex i = 0; i < CFArrayGetCount(bundleList); ++i) { other = base::mac::CFCast(CFArrayGetValueAtIndex(bundleList, i)); if (![identifier isEqualToString: (__bridge NSString *)other]) { diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index 6e3fc83..6992668 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -414,7 +414,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item"; NSMutableArray* generatedItems = [NSMutableArray array]; NSMutableArray* identifiers = [self identifiersFromSettings:items]; - for (NSUInteger i = 0; i < [identifiers count]; i++) { + for (NSUInteger i = 0; i < [identifiers count]; ++i) { if ([identifiers objectAtIndex:i] != NSTouchBarItemIdentifierOtherItemsProxy) { NSTouchBarItem* generatedItem = [self makeItemForIdentifier:[identifiers objectAtIndex:i]]; if (generatedItem) { @@ -474,7 +474,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item"; settings.Get("segments", &segments); control.segmentCount = segments.size(); - for (size_t i = 0; i < segments.size(); i++) { + for (size_t i = 0; i < segments.size(); ++i) { std::string label; gfx::Image image; bool enabled = true; -- 2.7.4