• Yorick Peterse's avatar
    Tweak checking branches in Project#open_branches · b6a18f10
    Yorick Peterse authored
    This changes 4 things:
    
    1. Project#protected_branches_names has been renamed to
       Project#protected_branch_names.
    
    2. Project#open_branches uses a Set for the branch names as checking
       values in a Set is faster than checking values in a (large) Array.
    
    3. Some redundant code in Project#open_branches has been removed.
    
    4. Project#protected_branch_names now uses #pluck instead of #map,
       removing the need for loading entire DB records into memory.
    b6a18f10
project.rb 30.3 KB