summaryrefslogtreecommitdiff
path: root/ext/-test-/st/numhash
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 14:50:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-29 14:50:20 +0000
commit28cc4f75437eec9e76f52723f042445332fd86f5 (patch)
tree2eb33997a9469dcf62a1ccd03f16777f8f22660e /ext/-test-/st/numhash
parent6da92c3e89697e1263248ab56e2ad33381429d6c (diff)
* st.c (st_update): pass pointer to key to the callback function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/st/numhash')
-rw-r--r--ext/-test-/st/numhash/numhash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/-test-/st/numhash/numhash.c b/ext/-test-/st/numhash/numhash.c
index 599678dde1..c746ac5495 100644
--- a/ext/-test-/st/numhash/numhash.c
+++ b/ext/-test-/st/numhash/numhash.c
@@ -60,9 +60,9 @@ numhash_each(VALUE self)
}
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;