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

Remove unnecessary .compact call #562

Merged

Conversation

tagliala
Copy link
Contributor

The .compact method is used to remove nil elements from an array. However, in this context, it is unnecessary because the .map operation is already creating an array of strings, and there's no nil values that could be removed

Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8f51900) 94.34% compared to head (4835955) 94.34%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #562   +/-   ##
=======================================
  Coverage   94.34%   94.34%           
=======================================
  Files          17       17           
  Lines         460      460           
=======================================
  Hits          434      434           
  Misses         26       26           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@javierjulio javierjulio self-requested a review December 15, 2023 16:55
Copy link
Member

@javierjulio javierjulio left a comment

Choose a reason for hiding this comment

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

Thanks! I'm not sure why I left that in.

The `.compact` method is used to remove nil elements from an array.
However, in this context, it is unnecessary because the `.map` operation
is already creating an array of strings, and there's no `nil` values
that could be removed
@tagliala tagliala force-pushed the chore/remove-redundant-compact branch from 20c8ffb to 4835955 Compare December 16, 2023 06:59
@tagliala tagliala merged commit 55cb6d3 into activeadmin:master Dec 16, 2023
19 checks passed
@tagliala tagliala deleted the chore/remove-redundant-compact branch December 16, 2023 07:07
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