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

Fix performance cops #9230

Merged

Conversation

mhashizume
Copy link
Contributor

This PR comprises fixes to Rubocop performance cop violations to support updating Rubocop and its extensions in #9222

Ruby 2.7 introduced Enumerable#filter_map that allows elements of an
enumerable block to be transformed and remove falsy results. This commit
updates all instances of collect/map { ... }.compact with filter_map.

This was identified by the Rubocop Performance/MapCompact cop.
This commit replaces an instance of bind(obj).call(args) with the more
performance bind_call(obj, args) method introduced in Ruby 2.7.

This was identified by the Rubocop Performance/BindCall cop.
@mhashizume mhashizume added the maintenance Maintenance chores are excluded from changelogs label Jan 29, 2024
@mhashizume mhashizume requested review from a team as code owners January 29, 2024 19:33
@tvpartytonight tvpartytonight merged commit a20a869 into puppetlabs:main Jan 29, 2024
10 checks passed
@mhashizume mhashizume deleted the maint/main/new-performance-cops branch February 1, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants