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

Add new ZipForArrayWrapping cop #462

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 27, 2024

  1. Add new ZipForArrayWrapping cop

    Add new `Performance/ZipForArrayWrapping` cop that checks patterns like `.map { |id| [id] }` or `.map { [_1] }` and can safely replace them with `.zip`
    
    This is a Performance Cop for the more efficient way to generate an Array of Arrays.
    
     * Performs 40-90% faster than `.map` to iteratively wrap array contents.
     * Performs 5 - 55% faster on ranges, depending on size.
    corsonknowles committed Oct 27, 2024
    Configuration menu
    Copy the full SHA
    2697a86 View commit details
    Browse the repository at this point in the history