Преглед на файлове

Explicit NSNumber pointer check

The static analyzer points out a potential ambiguity where `if (number) { ... }`, where `number` is a `NSNumber` might be construed as either `if (number != nil) { ... }` or `if ([number boolValue]) { ... }`. They suggest making it explicit to avoid any ambiguity.
Robert M. Ryan преди 8 години
родител
ревизия
e167d5494c
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/fmdb/FMResultSet.m

+ 1 - 1
src/fmdb/FMResultSet.m

@@ -221,7 +221,7 @@ - (int)columnIndexForName:(NSString*)columnName {
     
     NSNumber *n = [[self columnNameToIndexMap] objectForKey:columnName];
     
-    if (n) {
+    if (n != nil) {
         return [n intValue];
     }