set-nth-pair ( value key array n -- ) (original) (raw)

set-nth-pair ( value key array n -- )
Factor handbook » The language » Collections » Hashtables » Hashtable implementation details

Prev: ( n -- array )
Next: rehash ( hash -- )

Vocabulary
hashtables.private

Inputs

value the second element of the pair
key the first element of the pair
array the underlying array of the hashtable
n an index in the sequence

Outputs
None

Word description
Stores a pair of values into the elements with index n and n+1, respectively.

Warning
This word is in the hashtables.private vocabulary because it does not perform bounds checks.

Side effects
Modifies seq

Definition

USING: kernel math.private slots.private ;

IN: hashtables.private

: set-nth-pair ( value key array n -- )
2 fixnum+fast [ set-slot ] 2keep 1 fixnum+fast set-slot ;
inline