284
285
set(key: K, value: V, touch: Touch = Touch.None): this {
286
>
let item = this._map.get(key);
map.ts
287
>
if (item) {
288
item.value = value;
289
if (touch !== Touch.None) {
290
this.touch(item, touch);
291
}
293
>
item = { key, value, next: undefined, previous: undefined };
294
>
switch (touch) {
295
>
case Touch.None:
296
this.addItemLast(item);
297
break;
298
>
case Touch.AsOld:
map.ts
299
this.addItemFirst(item);
300
break;
301
>
case Touch.AsNew:
map.ts
302
this.addItemLast(item);
303
break;
305
this.addItemLast(item);
306
break;
308
>
this._map.set(key, item);
309
>
this._size++;
310
>
}
311
>
return this;
312
>
}
313
314
delete(key: K): boolean {