Project

General

Profile

Actions

Feature #6557

closed

Make rb_hash_clear() public

Added by ibc (Iñaki Baz Castillo) over 12 years ago. Updated almost 12 years ago.

Status:
Closed
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

Like0
Like0Like0Like0Like0