Skip to content

Minor improvements #175

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

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Conversation

tagliala
Copy link
Contributor

  • Use String#end_with? instead of AS alias
  • Use filter_map instead of map.compact
  • Fix safe Style/RedundantSelf offenses

In supported Active Support versions, `ends_with?` is an alias for
`end_with?`

No performance gain for this change
Ruby 2.7 added `Enumerable#filter_map`.

`all_transformations` is a `Hash`, and `Hash` includes the `Enumerable` module,
this is a safe change.

Fix Performance/MapCompact offence.

Ref: https://ruby-doc.org/core-3.1.0/Hash.html
@tagliala tagliala mentioned this pull request Nov 27, 2024
4 tasks
Copy link
Owner

@jamesmartin jamesmartin left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! ✨

@jamesmartin jamesmartin merged commit 0646994 into jamesmartin:master Nov 29, 2024
7 checks passed
@tagliala tagliala deleted the chore/minor-improvements branch December 2, 2024 22:23
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