Returns the total number of keys in an hash table.

# S3 method for class 'r2r_hashtable'
length(x)

Arguments

x

an hashset or hashmap.

Value

an integer. Number of keys in the hash table (or elements in a set).

Author

Valerio Gherardi

Examples

s <- hashset()
insert(s, "foo")
length(s)
#> [1] 1