Skip to content

Commit fd673c4

Browse files
justingrantptomato
authored andcommitted
Fix bug with cache holding fewer items than normal
If the cache was cloned from another one, then existing entries were counted twice.
1 parent ee660fa commit fd673c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

polyfill/lib/calendar.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ class OneObjectCache {
419419
this.hits = 0;
420420
this.misses = 0;
421421
if (cacheToClone !== undefined) {
422-
let i = cacheToClone.length;
422+
let i = 0;
423423
for (const entry of cacheToClone.map.entries()) {
424424
if (++i > OneObjectCache.MAX_CACHE_ENTRIES) break;
425425
this.map.set(...entry);

0 commit comments

Comments
 (0)