diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-25 23:06:48 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-25 23:06:48 +0000 |
commit | 9f1c009497431a5fd161eb530f8f1ccfbe0acac3 (patch) | |
tree | 585cbb72c39af6cf202074b53a9c43b04531a19d /test | |
parent | cc5547a4ade99311a9fe37754083f996a6c83a2d (diff) | |
download | ruby-9f1c009497431a5fd161eb530f8f1ccfbe0acac3.tar.gz |
enum.c (enum_minmax): simplify return value creation
No need to call three functions on success when one will do.
This results in less LoC and smaller object code, too:
text data bss dec hex filename
33860 0 296 34156 856c gcc/enum.o-before
33852 0 296 34148 8564 gcc/enum.o
* enum.c (enum_minmax): simplify return value creation
* test/ruby/test_enum.rb: test behavior on empty
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_enum.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb index db03b7bb7b..9260c43ec2 100644 --- a/test/ruby/test_enum.rb +++ b/test/ruby/test_enum.rb @@ -304,6 +304,7 @@ class TestEnumerable < Test::Unit::TestCase assert_equal([1, 3], [2,3,1].minmax) assert_equal([3, 1], [2,3,1].minmax {|a,b| b <=> a }) assert_equal([1, 3], [2,2,3,3,1,1].minmax) + assert_equal([nil, nil], [].minmax) end def test_min_by |