summaryrefslogtreecommitdiff
path: root/ext/-test-/st/update
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 07:36:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 07:36:12 +0000
commit30cea657676db0ba703ae769fed4eafd5abc27fc (patch)
tree0f607ae4ea699393cb7ae9bfdf97cb600c30112c /ext/-test-/st/update
parent95b30b0d07c40a3f7e0f0d8c74b1ae058034c8ad (diff)
* st.c (st_update): add existing parameter to the callback function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/st/update')
-rw-r--r--ext/-test-/st/update/update.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/-test-/st/update/update.c b/ext/-test-/st/update/update.c
index 33db04270c..0c82a7a091 100644
--- a/ext/-test-/st/update/update.c
+++ b/ext/-test-/st/update/update.c
@@ -2,9 +2,9 @@
#include <ruby/st.h>
static int
-update_func(st_data_t key, st_data_t *value, st_data_t arg)
+update_func(st_data_t key, st_data_t *value, st_data_t arg, int existing)
{
- VALUE ret = rb_yield_values(2, (VALUE)key, (VALUE)*value);
+ VALUE ret = rb_yield_values(existing ? 2 : 1, (VALUE)key, (VALUE)*value);
switch (ret) {
case Qfalse:
return ST_STOP;