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
ef3bbd2e
Commit
ef3bbd2e
authored
Dec 25, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid block_given? in enum.rb to reduce method calls
parent
6eeaef70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mrblib/enum.rb
mrblib/enum.rb
+3
-3
No files found.
mrblib/enum.rb
View file @
ef3bbd2e
...
...
@@ -72,7 +72,7 @@ module Enumerable
#
# ISO 15.3.2.2.3
def
collect
(
&
block
)
return
to_enum
:collect
unless
block
_given?
return
to_enum
:collect
unless
block
ary
=
[]
self
.
each
{
|*
val
|
...
...
@@ -108,7 +108,7 @@ module Enumerable
#
# ISO 15.3.2.2.5
def
each_with_index
(
&
block
)
return
to_enum
:each_with_index
unless
block
_given?
return
to_enum
:each_with_index
unless
block
i
=
0
self
.
each
{
|*
val
|
...
...
@@ -146,7 +146,7 @@ module Enumerable
#
# ISO 15.3.2.2.8
def
find_all
(
&
block
)
return
to_enum
:find_all
unless
block
_given?
return
to_enum
:find_all
unless
block
ary
=
[]
self
.
each
{
|*
val
|
...
...
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