mirror of
https://github.com/torproject/metrics-web.git
synced 2024-11-23 09:39:47 +00:00
Use more powerful Map methods.
This commit is contained in:
parent
cb966bc48c
commit
c5f0530e1b
@ -87,11 +87,7 @@ public class News {
|
||||
}
|
||||
List<String> placeNames = new ArrayList<>();
|
||||
for (String place : this.places) {
|
||||
if (countries.containsKey(place)) {
|
||||
placeNames.add(countries.get(place));
|
||||
} else {
|
||||
placeNames.add("Unknown Country");
|
||||
}
|
||||
placeNames.add(countries.getOrDefault(place, "Unknown Country"));
|
||||
}
|
||||
return placeNames;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user