Project

General

Profile

Actions

Feature #6557

closed

Make rb_hash_clear() public

Added by ibc (Iñaki Baz Castillo) about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
[ruby-core:45480]

Description

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;
}
Actions

Also available in: Atom PDF