ruby-changes:5094
From: knu <ko1@a...>
Date: Sun, 25 May 2008 19:54:19 +0900 (JST)
Subject: [ruby-changes:5094] Ruby:r16589 (ruby_1_8): * hash.c (env_delete_if): Return an enumerator if no block is
knu 2008-05-25 19:54:10 +0900 (Sun, 25 May 2008) New Revision: 16589 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/hash.c Log: * hash.c (env_delete_if): Return an enumerator if no block is given. (env_each_key): Delay a variable initialization after RETURN_ENUMERATOR(). http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16589&r2=16588&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/hash.c?r1=16589&r2=16588&diff_format=u Index: ruby_1_8/hash.c =================================================================== --- ruby_1_8/hash.c (revision 16588) +++ ruby_1_8/hash.c (revision 16589) @@ -2097,10 +2097,11 @@ env_each_key(ehash) VALUE ehash; { - VALUE keys = env_keys(); + VALUE keys; long i; RETURN_ENUMERATOR(ehash, 0, 0); + keys = env_keys(); for (i=0; i<RARRAY(keys)->len; i++) { rb_yield(RARRAY(keys)->ptr[i]); } @@ -2215,6 +2216,7 @@ env_delete_if(ehash) VALUE ehash; { + RETURN_ENUMERATOR(ehash, 0, 0); env_reject_bang(ehash); return envtbl; } Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 16588) +++ ruby_1_8/ChangeLog (revision 16589) @@ -1,3 +1,10 @@ +Sun May 25 19:48:12 2008 Akinori MUSHA <knu@i...> + + * hash.c (env_delete_if): Return an enumerator if no block is + given. + (env_each_key): Delay a variable initialization after + RETURN_ENUMERATOR(). + Sun May 25 05:07:19 2008 Akinori MUSHA <knu@i...> * array.c (rb_ary_slice_bang): Be consistent with Array#slice() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/