ruby-changes:23135
From: nobu <ko1@a...>
Date: Sat, 31 Mar 2012 07:48:45 +0900 (JST)
Subject: [ruby-changes:23135] nobu:r35185 (trunk): * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is
nobu 2012-03-31 07:47:33 +0900 (Sat, 31 Mar 2012) New Revision: 35185 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35185 Log: * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is not special value, so use 0 instead. therefore this function can be applied to only st_table which 0 is invalid as keys, e.g., IDs. Modified files: trunk/ChangeLog trunk/hash.c Index: ChangeLog =================================================================== --- ChangeLog (revision 35184) +++ ChangeLog (revision 35185) @@ -1,5 +1,9 @@ -Sat Mar 31 07:44:30 2012 Nobuyoshi Nakada <nobu@r...> +Sat Mar 31 07:47:31 2012 Nobuyoshi Nakada <nobu@r...> + * hash.c (st_foreach_safe): since table is not for VALUE, Qundef is + not special value, so use 0 instead. therefore this function can be + applied to only st_table which 0 is invalid as keys, e.g., IDs. + * hash.c: Qundef cannot be passed from st_foreach_check(). * hash.c, marshal.c, object.c, variable.c: fix callback argument types Index: hash.c =================================================================== --- hash.c (revision 35184) +++ hash.c (revision 35185) @@ -131,7 +131,7 @@ arg.tbl = table; arg.func = (st_foreach_func *)func; arg.arg = a; - if (st_foreach_check(table, foreach_safe_i, (st_data_t)&arg, (st_data_t)Qundef)) { + if (st_foreach_check(table, foreach_safe_i, (st_data_t)&arg, 0)) { rb_raise(rb_eRuntimeError, "hash modified during iteration"); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/