mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-09-03 03:07:55 +00:00
The 'filter().findAny().isPresent()' chain can be replaced with 'anyMatch()'
This commit is contained in:
@@ -44,7 +44,7 @@ public class BlackListUrlFilter extends AbstractGatewayFilterFactory<BlackListUr
|
||||
|
||||
public boolean matchBlacklist(String url)
|
||||
{
|
||||
return blacklistUrlPattern.isEmpty() ? false : blacklistUrlPattern.stream().filter(p -> p.matcher(url).find()).findAny().isPresent();
|
||||
return !blacklistUrlPattern.isEmpty() && blacklistUrlPattern.stream().anyMatch(p -> p.matcher(url).find());
|
||||
}
|
||||
|
||||
public List<String> getBlacklistUrl()
|
||||
|
Reference in New Issue
Block a user