Skip to content

Commit

Permalink
perf: ⚡️ use integer as default LRU limit
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Aug 11, 2024
1 parent 65eb152 commit 5b55327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/LruMap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export class LruMap<K, V> extends Map<K, V> {
constructor(public readonly limit: number = Infinity) {
constructor(
// 2^30 - 1 (a SMI in V8, for 32-bit platforms)
public readonly limit: number = 1073741823,
) {
super();
}

Expand Down

0 comments on commit 5b55327

Please sign in to comment.