File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
src/main/java/fr/adrienbrault/idea/symfony2plugin/routing Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -197,17 +197,17 @@ public static PsiElement[] getMethodsForPathWithPlaceholderMatch(@NotNull Projec
197
197
*/
198
198
@ NotNull
199
199
public static Collection <Route > getRoutesForPathWithPlaceholderMatch (@ NotNull Project project , @ NotNull String searchPath ) {
200
- Collection <Route > targets = new ArrayList <>();
201
-
202
- RouteHelper .getAllRoutes (project ).values ()
200
+ return new ArrayList <>(RouteHelper .getAllRoutes (project ).values ())
203
201
.parallelStream ()
204
- .forEach (route -> {
205
- if (route != null && isReverseRoutePatternMatch (route , searchPath )) {
206
- targets .add (route );
202
+ .filter (Objects ::nonNull )
203
+ .map (route -> {
204
+ if (isReverseRoutePatternMatch (route , searchPath )) {
205
+ return route ;
207
206
}
208
- });
209
-
210
- return targets ;
207
+ return null ;
208
+ })
209
+ .filter (Objects ::nonNull )
210
+ .collect (Collectors .toList ());
211
211
}
212
212
213
213
/**
You can’t perform that action at this time.
0 commit comments