mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use each_with_object instead of reduce.
For fix Codacy issue.
This commit is contained in:
+3
-2
@@ -336,7 +336,7 @@ module MRuby
|
||||
end
|
||||
|
||||
def generate_gem_table build
|
||||
gem_table = reduce({}) { |res,v| res[v.name] = v; res }
|
||||
gem_table = each_with_object({}) { |spec, h| h[spec.name] = spec }
|
||||
|
||||
default_gems = {}
|
||||
each do |g|
|
||||
@@ -430,7 +430,8 @@ module MRuby
|
||||
end
|
||||
|
||||
def import_include_paths(g)
|
||||
gem_table = reduce({}) { |res,v| res[v.name] = v; res }
|
||||
gem_table = each_with_object({}) { |spec, h| h[spec.name] = spec }
|
||||
|
||||
g.dependencies.each do |dep|
|
||||
dep_g = gem_table[dep[:gem]]
|
||||
# We can do recursive call safely
|
||||
|
||||
Reference in New Issue
Block a user