reset-hash ( n hash -- ) (original) (raw)

reset-hash ( n hash -- )

Vocabulary
hashtables.private

Inputs

n a positive integer specifying hashtable capacity
hash a hashtable

Outputs
None

Word description
Resets the underlying array of the hashtable to a new array with the given capacity. Removes all entries from the hashtable.

Side effects
Modifies hash

Definition

USING: accessors kernel ;

IN: hashtables.private

: reset-hash ( n hash -- )
swap >>array init-hash ; inline