mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Saving a couple cycles to avoid recalculating known results in the grantingNames array.
--HG-- branch : dev
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Orchard.Roles.Services {
|
|||||||
if (!context.Granted) {
|
if (!context.Granted) {
|
||||||
|
|
||||||
// determine which set of permissions would satisfy the access check
|
// determine which set of permissions would satisfy the access check
|
||||||
var grantingNames = PermissionNames(context.Permission, Enumerable.Empty<string>()).ToArray();
|
var grantingNames = PermissionNames(context.Permission, Enumerable.Empty<string>()).Distinct().ToArray();
|
||||||
|
|
||||||
// determine what set of roles should be examined by the access check
|
// determine what set of roles should be examined by the access check
|
||||||
IEnumerable<string> rolesToExamine;
|
IEnumerable<string> rolesToExamine;
|
||||||
|
Reference in New Issue
Block a user