Skip to content

Commit 3037e3f

Browse files
authored
Silenced some code analyzer warnings. (#792)
* Silenced some code analyzer warnings.
1 parent 2f522f2 commit 3037e3f

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

Branch-SDK/Branch-SDK/BNCCommerceEvent.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ - (NSMutableDictionary*) dictionary {
237237
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
238238

239239
#define assign(x) \
240-
do { if (self.x) { dictionary[@#x] = self.x; } } while (0)
240+
do { if (self.x != nil) { dictionary[@#x] = self.x; } } while (0)
241241

242242
assign(sku);
243243
assign(name);

Branch-SDK/Branch-SDK/BNCFieldDefines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
}
150150

151151
#define addNumber(field, name) { \
152-
if (self.field) { \
152+
if (self.field != nil) { \
153153
dictionary[@#name] = self.field; \
154154
} \
155155
}

Branch-SDK/Branch-SDK/BNCPreferenceHelper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ - (BOOL)readBoolFromDefaults:(NSString *)key {
801801
- (NSInteger)readIntegerFromDefaults:(NSString *)key {
802802
@synchronized(self) {
803803
NSNumber *number = self.persistenceDict[key];
804-
if (number) {
804+
if (number != nil) {
805805
return [number integerValue];
806806
}
807807
return NSNotFound;

Branch-SDK/Branch-SDK/Networking/BNCNetworkService.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
#pragma mark - BNCNetworkService
3434

3535
@interface BNCNetworkService : NSObject <BNCNetworkServiceProtocol>
36-
+ (id<BNCNetworkServiceProtocol>) new;
36+
+ (instancetype) new;
3737

3838
- (void) cancelAllOperations;
3939

4040
- (BNCNetworkOperation*) networkOperationWithURLRequest:(NSMutableURLRequest*)request
41-
completion:(void (^)(BNCNetworkOperation*operation))completion;
41+
completion:(void (^)(id<BNCNetworkOperationProtocol>operation))completion;
4242

4343
- (NSError*) pinSessionToPublicSecKeyRefs:(NSArray/**<SecKeyRef>*/*)publicKeys;
4444

Branch-SDK/Branch-SDK/Networking/BNCNetworkService.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ - (NSString*) stringFromResponseData {
7575

7676
@implementation BNCNetworkService
7777

78-
+ (id<BNCNetworkServiceProtocol>) new {
78+
+ (instancetype) new {
7979
return [[self alloc] init];
8080
}
8181

@@ -173,7 +173,7 @@ - (BOOL) operationsAreSuspended {
173173
#pragma mark - Operations
174174

175175
- (BNCNetworkOperation*) networkOperationWithURLRequest:(NSMutableURLRequest*)request
176-
completion:(void (^)(BNCNetworkOperation*operation))completion {
176+
completion:(void (^)(id<BNCNetworkOperationProtocol>operation))completion {
177177

178178
BNCNetworkOperation *operation = [BNCNetworkOperation new];
179179
if (![request isKindOfClass:[NSMutableURLRequest class]]) {

0 commit comments

Comments
 (0)