Remove unnecessary authority comparison.

Issue: gh-7035
This commit is contained in:
Karel Maxa 2019-07-11 15:37:34 +02:00
parent 0fea2fb256
commit 2d36062846

View File

@ -192,7 +192,7 @@ public class RoleHierarchyImpl implements RoleHierarchy {
} else {
rolesReachableInOneStepSet = this.rolesReachableInOneStepMap.get(higherRole);
}
addReachableRoles(rolesReachableInOneStepSet, lowerRole);
rolesReachableInOneStepSet.add(lowerRole);
if (logger.isDebugEnabled()) {
logger.debug("buildRolesReachableInOneStepMap() - From role " + higherRole
+ " one can reach role " + lowerRole + " in one step.");
@ -227,7 +227,7 @@ public class RoleHierarchyImpl implements RoleHierarchy {
// take a role from the rolesToVisit set
GrantedAuthority aRole = rolesToVisitSet.iterator().next();
rolesToVisitSet.remove(aRole);
addReachableRoles(visitedRolesSet, aRole);
visitedRolesSet.add(aRole);
if (this.rolesReachableInOneStepMap.containsKey(aRole)) {
Set<GrantedAuthority> newReachableRoles = this.rolesReachableInOneStepMap
.get(aRole);