Skip to content

Commit 7186667

Browse files
committed
SDK-842 use modern dictionary syntax
1 parent fc48967 commit 7186667

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Branch-SDK-Tests/BNCDeviceInfoTests.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ - (void)testLocalIPAddress {
136136
- (void)testV2Dictionary {
137137
NSDictionary *dict = [self.deviceInfo v2dictionary];
138138
XCTAssertNotNil(dict);
139-
XCTAssertNotNil([dict objectForKey:@"brand"]);
140-
XCTAssertNotNil([dict objectForKey:@"os"]);
141-
XCTAssertNotNil([dict objectForKey:@"sdk"]);
142-
XCTAssertNotNil([dict objectForKey:@"sdk_version"]);
139+
XCTAssertNotNil(dict[@"brand"]);
140+
XCTAssertNotNil(dict[@"os"]);
141+
XCTAssertNotNil(dict[@"sdk"]);
142+
XCTAssertNotNil(dict[@"sdk_version"]);
143143

144-
XCTAssertNil([dict objectForKey:@"disable_ad_network_callouts"]);
144+
XCTAssertNil(dict[@"disable_ad_network_callouts"]);
145145
}
146146

147147
@end

Branch-SDK-Tests/BNCDisableAdNetworkCalloutsTests.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ - (void)tearDown {
3535
- (void)testV2Dictionary {
3636
NSDictionary *dict = [[BNCDeviceInfo getInstance] v2dictionary];
3737
XCTAssertNotNil(dict);
38-
XCTAssertNotNil([dict objectForKey:@"brand"]);
39-
XCTAssertNotNil([dict objectForKey:@"os"]);
40-
XCTAssertNotNil([dict objectForKey:@"sdk"]);
41-
XCTAssertNotNil([dict objectForKey:@"sdk_version"]);
38+
XCTAssertNotNil(dict[@"brand"]);
39+
XCTAssertNotNil(dict[@"os"]);
40+
XCTAssertNotNil(dict[@"sdk"]);
41+
XCTAssertNotNil(dict[@"sdk_version"]);
4242

43-
XCTAssertTrue([dict objectForKey:@"disable_ad_network_callouts"]);
43+
XCTAssertTrue(dict[@"disable_ad_network_callouts"]);
4444
}
4545

4646
// check on V1 payload
@@ -52,7 +52,7 @@ - (void)testV1Payload {
5252
[interface updateDeviceInfoToMutableDictionary:tmp];
5353

5454
XCTAssertNotNil(tmp);
55-
XCTAssertTrue([tmp objectForKey:@"disable_ad_network_callouts"]);
55+
XCTAssertTrue(tmp[@"disable_ad_network_callouts"]);
5656
}
5757

5858
@end

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ - (NSDictionary *)v2dictionary {
151151

152152
BOOL disableAdNetworkCallouts = [BNCPreferenceHelper preferenceHelper].disableAdNetworkCallouts;
153153
if (disableAdNetworkCallouts) {
154-
[dictionary setObject:[NSNumber numberWithBool:disableAdNetworkCallouts] forKey:@"disable_ad_network_callouts"];
154+
dictionary[@"disable_ad_network_callouts"] = [NSNumber numberWithBool:disableAdNetworkCallouts];
155155
}
156156

157157
if ([BNCPreferenceHelper preferenceHelper].isDebug) {

0 commit comments

Comments
 (0)