Skip to content

Commit a2e738f

Browse files
authored
incrementCount refactor (#208)
1 parent fde7e70 commit a2e738f

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Example/Tests/Classes/LPCountAggregatorTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AppIconManagerTest.m
33
// Leanplum-SDK
44
//
5-
// Created by Alexis Oyama on 3/2/17.
5+
// Created by Grace Gu on 9/11/18.
66
// Copyright © 2017 Leanplum. All rights reserved.
77
//
88
// Licensed to the Apache Software Foundation (ASF) under one

Leanplum-SDK/Classes/Managers/LPCountAggregator.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,7 @@ - (instancetype)init {
5555
}
5656

5757
- (void)incrementCount:(nonnull NSString *)name {
58-
if ([self.enabledCounters containsObject:name]) {
59-
int count = 0;
60-
if ([self.counts objectForKey:name]) {
61-
count = [self.counts[name] intValue];
62-
}
63-
count = count + 1;
64-
self.counts[name] = [NSNumber numberWithInt:count];
65-
}
58+
[self incrementCount:name by: 1];
6659
}
6760

6861
- (void)incrementCount:(nonnull NSString *)name by:(int)incrementCount {

0 commit comments

Comments
 (0)