Skip to content

Commit 624e1b2

Browse files
committed
PR feedback
1 parent 93be68b commit 624e1b2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/browser/src/profiling/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,8 @@ export function addProfileToGlobalCache(profile_id: string, profile: JSSelfProfi
564564
PROFILE_MAP.set(profile_id, profile);
565565

566566
if (PROFILE_MAP.size > 30) {
567-
const last = PROFILE_MAP.keys().next().value;
568-
if (last) {
569-
PROFILE_MAP.delete(last);
570-
}
567+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
568+
const last = PROFILE_MAP.keys().next().value!;
569+
PROFILE_MAP.delete(last);
571570
}
572571
}

packages/core/src/utils/lru.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ export class LRUMap<K, V> {
2727
public set(key: K, value: V): void {
2828
if (this._cache.size >= this._maxSize) {
2929
// keys() returns an iterator in insertion order so keys().next() gives us the oldest key
30-
const nextKey = this._cache.keys().next().value;
31-
if (nextKey) {
32-
this._cache.delete(nextKey);
33-
}
30+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
31+
const nextKey = this._cache.keys().next().value!;
32+
this._cache.delete(nextKey);
3433
}
3534
this._cache.set(key, value);
3635
}

0 commit comments

Comments
 (0)