Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable short-circuiting in has_cached_role #519

Conversation

thomas-mcdonald
Copy link
Member

Rather than iterate through the entire roles array and then report if
there are any values returned, we can instead use any? with a block
that will short-circuit when the first truthy value is returned.

This changes the call signature for RoleAdapter#find_cached* to return
boolean rather than an array

Rather than iterate through the entire roles array and then report if
there are any values returned, we can instead use any? with a block
that will short-circuit when the first truthy value is returned.

This changes the call signature for RoleAdapter#find_cached* to return
boolean rather than an array
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.516% when pulling 33eeab2 on thomas-mcdonald:performance-patch-2 into e196d70 on RolifyCommunity:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.516% when pulling 33eeab2 on thomas-mcdonald:performance-patch-2 into e196d70 on RolifyCommunity:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants