mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 13:04:13 +02:00
Optimize enum_sum for a range from int to int
* enum.c (enum_sum): Optimize for a range from int to int. * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb, and add assertions for some conditions. * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb. * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
41d002bbad
commit
d5595a9627
7 changed files with 56 additions and 13 deletions
|
@ -1097,6 +1097,7 @@ VALUE rb_int_round(VALUE num, int ndigits);
|
|||
VALUE rb_int2str(VALUE num, int base);
|
||||
VALUE rb_dbl_hash(double d);
|
||||
VALUE rb_fix_plus(VALUE x, VALUE y);
|
||||
VALUE rb_int_ge(VALUE x, VALUE y);
|
||||
|
||||
#if USE_FLONUM
|
||||
#define RUBY_BIT_ROTL(v, n) (((v) << (n)) | ((v) >> ((sizeof(v) * 8) - n)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue