From 55dab36ce134dac54bbbf8d6742fd639873b4daf Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 19 May 2017 18:09:17 -0400 Subject: [PATCH] Respond to CR. // FREEBIE --- .../src/ViewControllers/DebugUITableViewController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Signal/src/ViewControllers/DebugUITableViewController.m b/Signal/src/ViewControllers/DebugUITableViewController.m index f2fa23a74..b890f92d8 100644 --- a/Signal/src/ViewControllers/DebugUITableViewController.m +++ b/Signal/src/ViewControllers/DebugUITableViewController.m @@ -175,7 +175,7 @@ NS_ASSUME_NONNULL_BEGIN @"Paul", @"Bertha", ]; - return values[arc4random() % values.count]; + return values[arc4random_uniform(values.count)]; } @@ -1183,18 +1183,18 @@ NS_ASSUME_NONNULL_BEGIN @"Noel", @"Vang", ]; - return values[arc4random() % values.count]; + return values[arc4random_uniform(values.count)]; } + (NSString *)randomPhoneNumber { - if (arc4random() % 2 == 0) { + if (arc4random_uniform(2) == 0) { // Generate a US phone number. NSMutableString *result = [@"+1" mutableCopy]; for (int i = 0; i < 10; i++) { // Add digits. - [result appendString:[@(arc4random() % 10) description]]; + [result appendString:[@(arc4random_uniform(10)) description]]; } return result; } else { @@ -1202,7 +1202,7 @@ NS_ASSUME_NONNULL_BEGIN NSMutableString *result = [@"+441" mutableCopy]; for (int i = 0; i < 9; i++) { // Add digits. - [result appendString:[@(arc4random() % 10) description]]; + [result appendString:[@(arc4random_uniform(10)) description]]; } return result; }