Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
482b2ea0
Commit
482b2ea0
authored
Dec 30, 2018
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `each_with_object` instead of `reduce`.
For fix Codacy issue.
parent
ce5e4544
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lib/mruby/gem.rb
lib/mruby/gem.rb
+3
-2
No files found.
lib/mruby/gem.rb
View file @
482b2ea0
...
@@ -336,7 +336,7 @@ module MRuby
...
@@ -336,7 +336,7 @@ module MRuby
end
end
def
generate_gem_table
build
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
=
{}
default_gems
=
{}
each
do
|
g
|
each
do
|
g
|
...
@@ -430,7 +430,8 @@ module MRuby
...
@@ -430,7 +430,8 @@ module MRuby
end
end
def
import_include_paths
(
g
)
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
|
g
.
dependencies
.
each
do
|
dep
|
dep_g
=
gem_table
[
dep
[
:gem
]]
dep_g
=
gem_table
[
dep
[
:gem
]]
# We can do recursive call safely
# We can do recursive call safely
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment