perf(api particulier): use filter_map
instead of map.compact
https://docs.rubocop.org/rubocop-performance/cops_performance.html#performancemapcompact
This commit is contained in:
parent
a24cf18c9d
commit
cfb8c184fe
1 changed files with 1 additions and 2 deletions
|
@ -7,8 +7,7 @@ module APIParticulier
|
|||
|
||||
def available_sources
|
||||
@procedure.api_particulier_scopes
|
||||
.map { |provider_and_scope| raw_scopes[provider_and_scope] }
|
||||
.compact
|
||||
.filter_map { |provider_and_scope| raw_scopes[provider_and_scope] }
|
||||
.map { |provider, scope| extract_sources(provider, scope) }
|
||||
.reduce({}) { |acc, el| acc.deep_merge(el) { |_, this_val, other_val| this_val + other_val } }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue