@@ -18,19 +18,19 @@ pub value struct hash-map-mut<k, v>
1818 amount : int
1919 seed : int64
2020
21- // Creates a hash-map-mut with a specified inital `capacity`.
21+ // Creates a hash-map-mut with a specified initial `capacity`.
2222// If zero then the hash-map-mut will set capacity to 1.
23- // The seed is initalized using the thread's id.
23+ // The seed is initialized using the thread's id.
2424pub fun hash-map-mut ( capacity : int = 1 ) : hash-map-mut < k, v>
2525 Hash-map-mut ( vector( if capacity > 0 then capacity else 1 , Nil ), 0 , seed )
2626
27- // Creates a hash-map-mut with a specified inital `capacity` and a user defined `seed`.
27+ // Creates a hash-map-mut with a specified initial `capacity` and a user defined `seed`.
2828// If zero then the hash-map-mut will set capacity to 1.
2929pub fun hash-map-mut-seeded ( seed : int64 , capacity : int = 1 ) : hash-map-mut < k, v>
3030 Hash-map-mut ( vector( if capacity > 0 then capacity else 1 , Nil ), 0 , seed )
3131
3232// Creates a hash-map from a list `xs`. This hash-map-mut has the same capacity as the length of the list `xs`.
33- // The seed is initalized from the thread's id.
33+ // The seed is initialized from the thread's id.
3434pub fun list/ hash-map-mut ( xs : list < ( k, v) > , ? hash : ( k, int64 ) -> int , ? (== ) : ( k, k) -> bool ) : hash-map-mut < k, v>
3535 from-list-helper( hash-map-mut( xs. length ), xs )
3636
@@ -104,7 +104,7 @@ pub fun remove( hm : hash-map-mut<k,v>, key : k, ?hash : (k, int64) -> int, ?(==
104104 data. unsafe-assign( position. ssize_t, bucket )
105105 Hash-map-mut ( data, amount - 1 , seed)
106106
107- // Attempts to retreve a value from the hash-map-mut with a given `key`. Returns `Nothing` if the key is invalid.
107+ // Attempts to retrieve a value from the hash-map-mut with a given `key`. Returns `Nothing` if the key is invalid.
108108pub fun get ( hm : hash-map-mut < k, v> , key : k, ? hash : ( k, int64 ) -> int , ? (== ) : ( k, k) -> bool ) : maybe < v>
109109 val the-hash = hash(key, hm. seed)
110110 val position = the-hash % hm. data. length
0 commit comments