@@ -103,13 +103,13 @@ public static void main(String[] args) throws IOException {
103
103
println (" ICMP=" + config .tryICMP );
104
104
println (" printOnlyICMP=" + SHOW_ONLY_ICMP );
105
105
106
- long localAS = Scion .defaultService ().getLocalIsdAs ();
107
106
PingAll demo = new PingAll ();
108
- List <ParseAssignments .HostEntry > list = DownloadAssignmentsFromWeb .getList ();
109
- for (ParseAssignments .HostEntry e : list ) {
110
- if (e .getIsdAs () == localAS ) {
111
- continue ;
112
- }
107
+ List <ParseAssignments .HostEntry > allASes = DownloadAssignmentsFromWeb .getList ();
108
+ // remove entry for local AS
109
+ long localAS = Scion .defaultService ().getLocalIsdAs ();
110
+ allASes = allASes .stream ().filter (e -> e .getIsdAs () != localAS ).collect (Collectors .toList ());
111
+ // Process all ASes
112
+ for (ParseAssignments .HostEntry e : allASes ) {
113
113
print (ScionUtil .toStringIA (e .getIsdAs ()) + " \" " + e .getName () + "\" " );
114
114
demo .runDemo (e );
115
115
listedAs .add (e .getIsdAs ());
@@ -446,13 +446,13 @@ private static double avg(Predicate<Result> filter, ToDoubleFunction<Result> map
446
446
return results .stream ().filter (filter ).mapToDouble (mapper ).average ().orElse (-1 );
447
447
}
448
448
449
-
450
449
private static Result max (Predicate <Result > filter , Comparator <Result > comparator ) {
451
450
return results .stream ().filter (filter ).max (comparator ).orElseThrow (NoSuchElementException ::new );
452
451
}
453
452
454
453
private static <T > double median (Predicate <Result > filter , Function <Result , T > mapper ) {
455
- List <T > list = results .stream ().filter (filter ).map (mapper ).sorted ().collect (Collectors .toList ());
454
+ List <T > list =
455
+ results .stream ().filter (filter ).map (mapper ).sorted ().collect (Collectors .toList ());
456
456
if (list .isEmpty ()) {
457
457
return -1 ;
458
458
}
0 commit comments