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

Improve Performance/MapCompact to handle more safe navigation calls #391

Merged

Conversation

fatkodima
Copy link
Contributor

Fixes #389.

@@ -39,11 +39,11 @@ class MapCompact < Base

def_node_matcher :map_compact, <<~PATTERN
{
(send
({send csend}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
({send csend}
(call

$(call _ {:map :collect}
(block_pass
(sym _))) _)
(send
({send csend}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
({send csend}
(call

@koic
Copy link
Member

koic commented Nov 25, 2023

CI has been failed. Can you rebase with the latest master branch?

@fatkodima fatkodima force-pushed the improve-map_compact-for-safe-handling branch from 37440fb to 6dbda67 Compare November 25, 2023 18:30
@fatkodima
Copy link
Contributor Author

Updated.

@koic koic merged commit eb714d9 into rubocop:master Nov 26, 2023
11 checks passed
@koic
Copy link
Member

koic commented Nov 26, 2023

Thanks!

@fatkodima fatkodima deleted the improve-map_compact-for-safe-handling branch November 26, 2023 10:25
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.

Make Performance/MapCompact aware of safe navigation operator
2 participants