Skip to content

Commit ce32d2f

Browse files
Update libs/hooks/debounce/src/lib/utils/fixed-size-expiring-cache.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Todd Baert <[email protected]>
1 parent 4ef6156 commit ce32d2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/hooks/debounce/src/lib/utils/fixed-size-expiring-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class FixedSizeExpiringCache<T> {
6868
*/
6969
set(key: string, value: T) {
7070
if (key) {
71-
if (this.cacheMap.size >= this.maxItems) {
71+
if (!this.cacheMap.has(key) && this.cacheMap.size >= this.maxItems) {
7272
this.evictOldest();
7373
}
7474
// delete first so that the order is updated when we re-set (Map keeps insertion order)

0 commit comments

Comments
 (0)