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
5b31ee9a
Commit
5b31ee9a
authored
Mar 23, 2014
by
Jun Hiroe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppoert multiple values in Enumerable#minmax_by
parent
776a680e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
mrbgems/mruby-enum-ext/mrblib/enum.rb
mrbgems/mruby-enum-ext/mrblib/enum.rb
+7
-7
No files found.
mrbgems/mruby-enum-ext/mrblib/enum.rb
View file @
5b31ee9a
...
...
@@ -395,18 +395,18 @@ module Enumerable
min_cmp
=
nil
first
=
true
self
.
each
do
|
val
|
self
.
each
do
|
*
val
|
if
first
max
=
min
=
val
max_cmp
=
min_cmp
=
block
.
call
(
val
)
max
=
min
=
val
.
__svalue
max_cmp
=
min_cmp
=
block
.
call
(
*
val
)
first
=
false
else
if
(
cmp
=
block
.
call
(
val
))
>
max_cmp
max
=
val
if
(
cmp
=
block
.
call
(
*
val
))
>
max_cmp
max
=
val
.
__svalue
max_cmp
=
cmp
end
if
(
cmp
=
block
.
call
(
val
))
<
min_cmp
min
=
val
if
(
cmp
=
block
.
call
(
*
val
))
<
min_cmp
min
=
val
.
__svalue
min_cmp
=
cmp
end
end
...
...
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