diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-28 09:09:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-28 09:09:18 +0000 |
commit | fe6cf485e6e1d23766a81246e825b61eb534c176 () | |
tree | cd029232507a85ab6612cb1a2383ae95d297ad98 | |
parent | 98273af3f7d0ea445a18d39f1e359c74b0cfb045 (diff) |
enum.c: Fixnum only
* enum.c (limit_by_enum_size, enum_size_over_p): check only against Fixnum size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | enum.c | 10 | ||||
-rw-r--r-- | test/ruby/test_lazy_enumerator.rb | 12 |
2 files changed, 17 insertions, 5 deletions
@@ -319,17 +319,17 @@ limit_by_enum_size(VALUE obj, long n) { unsigned long limit; VALUE size = rb_check_funcall(obj, id_size, 0, 0); - if (size == Qundef) return n; - limit = NUM2ULONG(size); - return ((unsigned long)n > limit) ? limit : n; } static int enum_size_over_p(VALUE obj, long n) { VALUE size = rb_check_funcall(obj, id_size, 0, 0); - if (size == Qundef) return 0; - return ((unsigned long)n > NUM2ULONG(size)); } /* @@ -483,6 +483,18 @@ EOS assert_equal Enumerator::Lazy, [].lazy.slice_when{}.class, bug7507 end def test_no_warnings le = (1..3).lazy assert_warning("") {le.zip([4,5,6]).force} |