File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -98,13 +98,13 @@ int main(int argc, const char * argv[]) {
9898 }
9999 dispatch_group_notify (group, dispatch_get_main_queue (), ^{
100100 if (sockets.count > 0 ) {
101- NSMutableArray <Tcping *> * successArray = [[ NSMutableArray alloc ] init ] ;
101+ NSInteger successCount = 0 ;
102102 NSTimeInterval min = INFINITY;
103103 NSTimeInterval max = 0 ;
104104 NSTimeInterval sum = 0 ;
105105 for (Tcping * t in sockets) {
106106 if (t.speed != INFINITY) {
107- [successArray addObject: t] ;
107+ successCount += 1 ;
108108 if (t.speed > max) {
109109 max = t.speed ;
110110 }
@@ -114,11 +114,11 @@ int main(int argc, const char * argv[]) {
114114 sum += t.speed ;
115115 }
116116 }
117- if (successArray. count == 0 ) {
117+ if (successCount == 0 ) {
118118 [ConsoleIO printReulst: YES detail: sockets[0 ] count: sockets.count lossCount: sockets.count min: [NSNumber numberWithDouble: min] max: [NSNumber numberWithDouble: max] avge: [NSNumber numberWithDouble: INFINITY]];
119119 } else {
120- double s = successArray. count *1.0 ;
121- [ConsoleIO printReulst: YES detail: sockets[0 ] count: sockets.count lossCount: sockets.count-successArray.count min: [NSNumber numberWithDouble: min] max: [NSNumber numberWithDouble: max] avge: [NSNumber numberWithDouble: sum/s]];
120+ double s = successCount *1.0 ;
121+ [ConsoleIO printReulst: YES detail: sockets[0 ] count: sockets.count lossCount: sockets.count-successCount min: [NSNumber numberWithDouble: min] max: [NSNumber numberWithDouble: max] avge: [NSNumber numberWithDouble: sum/s]];
122122 }
123123 running = NO ;
124124 }
You can’t perform that action at this time.
0 commit comments