From: "mame (Yusuke Endoh)" Date: 2012-11-24T14:18:21+09:00 Subject: [ruby-core:50017] [ruby-trunk - Feature #6557][Closed] Make rb_hash_clear() public Issue #6557 has been updated by mame (Yusuke Endoh). Status changed from Feedback to Closed Congrats, rb_hash_clear() was public since r37480. -- Yusuke Endoh ---------------------------------------- Feature #6557: Make rb_hash_clear() public https://bugs.ruby-lang.org/issues/6557#change-33791 Author: ibc (I��aki Baz Castillo) Status: Closed Priority: Normal Assignee: Category: core Target version: 1.9.3 Any reason for rb_hash_clear() not to be public C API?:
static VALUE
rb_hash_clear(VALUE hash)
{
    rb_hash_modify_check(hash);
    if (!RHASH(hash)->ntbl)
        return hash;
    if (RHASH(hash)->ntbl->num_entries > 0) {
        if (RHASH(hash)->iter_lev > 0)
            rb_hash_foreach(hash, clear_i, 0);
        else
            st_clear(RHASH(hash)->ntbl);
    }

    return hash;
}
-- http://bugs.ruby-lang.org/