mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
48436ac69e
* ext/-test-/hash/delete.c: add declaration of the function in internal.h. [Bug #10623] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
16 lines
337 B
C
16 lines
337 B
C
#include "ruby.h"
|
|
|
|
extern VALUE rb_hash_delete_entry(VALUE hash, VALUE key);
|
|
|
|
static VALUE
|
|
hash_delete(VALUE hash, VALUE key)
|
|
{
|
|
VALUE ret = rb_hash_delete_entry(hash, key);
|
|
return ret == Qundef ? Qnil : rb_ary_new_from_values(1, &ret);
|
|
}
|
|
|
|
void
|
|
Init_delete(VALUE klass)
|
|
{
|
|
rb_define_method(klass, "delete!", hash_delete, 1);
|
|
}
|