mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-13 05:54:17 +01:00
Fixed #4744
This commit is contained in:
parent
3c1961c846
commit
f8ec8e5ded
@ -30,10 +30,11 @@ public class GlobalTrainDisplayData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<TrainDeparturePrediction> prepare(String filter, int maxLines) {
|
public static List<TrainDeparturePrediction> prepare(String filter, int maxLines) {
|
||||||
|
String regex = filter.isBlank() ? filter : "\\Q" + filter.replace("*", "\\E.*\\Q") + "\\E";
|
||||||
return statusByDestination.entrySet()
|
return statusByDestination.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(e -> e.getKey()
|
.filter(e -> e.getKey()
|
||||||
.matches(filter.replace("*", ".*")))
|
.matches(regex))
|
||||||
.flatMap(e -> e.getValue()
|
.flatMap(e -> e.getValue()
|
||||||
.stream())
|
.stream())
|
||||||
.sorted()
|
.sorted()
|
||||||
|
Loading…
Reference in New Issue
Block a user