mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* enum.c (enum_sort_by): add WBs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92fa998ce7
commit
9c64155f30
2 changed files with 8 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Mar 19 04:46:36 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* enum.c (enum_sort_by): add WBs.
|
||||
|
||||
Thu Mar 19 03:37:52 2015 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* gc.c (check_rvalue_consistency): refactoring.
|
||||
|
|
8
enum.c
8
enum.c
|
@ -846,8 +846,8 @@ enum_sort(VALUE obj)
|
|||
|
||||
#define SORT_BY_BUFSIZE 16
|
||||
struct sort_by_data {
|
||||
VALUE ary;
|
||||
VALUE buf;
|
||||
const VALUE ary;
|
||||
const VALUE buf;
|
||||
long n;
|
||||
};
|
||||
|
||||
|
@ -989,8 +989,8 @@ enum_sort_by(VALUE obj)
|
|||
memo = MEMO_NEW(0, 0, 0);
|
||||
OBJ_INFECT(memo, obj);
|
||||
data = (struct sort_by_data *)&memo->v1;
|
||||
data->ary = ary;
|
||||
data->buf = buf;
|
||||
RB_OBJ_WRITE(memo, &data->ary, ary);
|
||||
RB_OBJ_WRITE(memo, &data->buf, buf);
|
||||
data->n = 0;
|
||||
rb_block_call(obj, id_each, 0, 0, sort_by_i, (VALUE)memo);
|
||||
ary = data->ary;
|
||||
|
|
Loading…
Add table
Reference in a new issue