API / Belt / HashSetInt

HashSetInt

This module is Belt.HashSet specialized with key type to be a primitive type.

It is more efficient in general, the API is the same with Belt.HashSet except its key type is fixed, and identity is not needed(using the built-in one).

key

RES
type key = int

t

RES
type t

make

let make: (~hintSize: int) => t

clear

let clear: t => unit

isEmpty

let isEmpty: t => bool

add

let add: (t, key) => unit

copy

let copy: t => t

has

let has: (t, key) => bool

remove

let remove: (t, key) => unit

forEachU

let forEachU: (t, (. key) => unit) => unit

forEach

let forEach: (t, key => unit) => unit

reduceU

let reduceU: (t, 'c, (. 'c, key) => 'c) => 'c

reduce

let reduce: (t, 'c, ('c, key) => 'c) => 'c

size

let size: t => int

logStats

let logStats: t => unit

toArray

let toArray: t => array<key>

fromArray

let fromArray: array<key> => t

mergeMany

let mergeMany: (t, array<key>) => unit

getBucketHistogram

let getBucketHistogram: t => array<int>