Permalink
Browse files

Fix comparison between NSNumber* and int

Summary:
Strangely comparing a pointer with zero will only be a clang warning when compiling with `-Wpedantic`, so this incorrect comparison is silently allowed.

**Test plan**

Compiles with `-Wpedantic`.
Closes #11709

Differential Revision: D4377512

Pulled By: ericvicenti

fbshipit-source-id: 483cf1f41d3f539c452d542ad2155c4c4b41616d
  • Loading branch information...
kastiglione authored and facebook-github-bot committed Jan 3, 2017
1 parent 26a8da8 commit 7123618aa863ab384d4091c52e9362a9afbbdec1
Showing with 1 addition and 1 deletion.
  1. +1 −1 React/Base/RCTJavaScriptLoader.mm
@@ -29,7 +29,7 @@ - (NSString *)description
NSMutableString *desc = [NSMutableString new];
[desc appendString:_status ?: @"Loading"];
if (_total > 0) {
if ([_total integerValue] > 0) {
[desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total];
}
[desc appendString:@"\u2026"];

0 comments on commit 7123618

Please sign in to comment.