我正在通过使用 foreach 遍历(权限)集合来寻找特定条件。所以如果我找到了我需要的所有东西并且不再需要循环,有没有办法打破循环?我对速度很陌生,并试图理解这种奇怪的语言。
#foreach ($perm in $space.getPermissions())
#end
我正在通过使用 foreach 遍历(权限)集合来寻找特定条件。所以如果我找到了我需要的所有东西并且不再需要循环,有没有办法打破循环?我对速度很陌生,并试图理解这种奇怪的语言。
#foreach ($perm in $space.getPermissions())
#end
最新版本的 Velocity (1.6) 包含语句#break
https://velocity.apache.org/engine/1.6.2/user-guide.html#Loops
## list first 5 customers only
#foreach( $customer in $customerList )
#if( $velocityCount > 5 )
#break
#end
$customer.Name
#end