@@ -15,7 +15,7 @@ import { Map } from "./map";
15
15
*/
16
16
export class HashMap < K , V > implements Map < K , V > {
17
17
private size ! : number ;
18
- private buckets ! : HashMapEntry < K , V > [ ] [ ] ;
18
+ private buckets ! : MapEntry < K , V > [ ] [ ] ;
19
19
private readonly loadFactor = 0.75 ;
20
20
21
21
constructor ( ) {
@@ -47,7 +47,7 @@ export class HashMap<K, V> implements Map<K, V> {
47
47
const bucket = this . buckets [ index ] ;
48
48
49
49
if ( bucket . length === 0 ) {
50
- bucket . push ( new HashMapEntry ( key , value ) ) ;
50
+ bucket . push ( new MapEntry ( key , value ) ) ;
51
51
this . size ++ ;
52
52
return ;
53
53
}
@@ -59,7 +59,7 @@ export class HashMap<K, V> implements Map<K, V> {
59
59
}
60
60
}
61
61
62
- bucket . push ( new HashMapEntry ( key , value ) ) ;
62
+ bucket . push ( new MapEntry ( key , value ) ) ;
63
63
this . size ++ ;
64
64
}
65
65
@@ -164,8 +164,8 @@ export class HashMap<K, V> implements Map<K, V> {
164
164
*
165
165
* @returns The entries.
166
166
*/
167
- entries ( ) : HashMapEntry < K , V > [ ] {
168
- const entries : HashMapEntry < K , V > [ ] = [ ] ;
167
+ entries ( ) : MapEntry < K , V > [ ] {
168
+ const entries : MapEntry < K , V > [ ] = [ ] ;
169
169
for ( const bucket of this . buckets ) {
170
170
for ( const entry of bucket ) {
171
171
entries . push ( entry ) ;
@@ -228,7 +228,7 @@ export class HashMap<K, V> implements Map<K, V> {
228
228
* @param key The key.
229
229
* @param value The value.
230
230
*/
231
- export class HashMapEntry < K , V > {
231
+ export class MapEntry < K , V > {
232
232
key : K ;
233
233
value : V ;
234
234
0 commit comments