优化新设备判断逻辑。Review by 硬币。
Showing
1 changed file
with
3 additions
and
4 deletions
@@ -408,9 +408,8 @@ static NSString * const kYohoBuyUsedDevice = @"com.yoho.buy.useddevice"; | @@ -408,9 +408,8 @@ static NSString * const kYohoBuyUsedDevice = @"com.yoho.buy.useddevice"; | ||
408 | 408 | ||
409 | + (BOOL) isNewDevice | 409 | + (BOOL) isNewDevice |
410 | { | 410 | { |
411 | - static NSString * usedDevice = nil; | ||
412 | - | ||
413 | - if ([usedDevice isEqualToString:@"Y"]) { | 411 | + static BOOL isNew = YES; |
412 | + if (isNew == NO) { | ||
414 | return NO; | 413 | return NO; |
415 | } | 414 | } |
416 | 415 | ||
@@ -418,7 +417,7 @@ static NSString * const kYohoBuyUsedDevice = @"com.yoho.buy.useddevice"; | @@ -418,7 +417,7 @@ static NSString * const kYohoBuyUsedDevice = @"com.yoho.buy.useddevice"; | ||
418 | if (yohoinfoKVPairs == nil || yohoinfoKVPairs[kYohoBuyUsedDevice] == nil) { | 417 | if (yohoinfoKVPairs == nil || yohoinfoKVPairs[kYohoBuyUsedDevice] == nil) { |
419 | return YES; | 418 | return YES; |
420 | } else { | 419 | } else { |
421 | - usedDevice = [NSString stringWithString:yohoinfoKVPairs[kYohoBuyUsedDevice]]; | 420 | + isNew = NO; |
422 | return NO; | 421 | return NO; |
423 | } | 422 | } |
424 | } | 423 | } |
-
Please register or login to post a comment