Skip to content

Commit eb76eb8

Browse files
committed
Website updates
1 parent 397953e commit eb76eb8

File tree

11 files changed

+21
-17
lines changed

11 files changed

+21
-17
lines changed

dist/en/main/apidoc/module-ol_structs_LRUCache-LRUCache.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ <h4 class="name">
245245

246246
<div class="tag-source">
247247
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/structs/LRUCache.js">structs/LRUCache.js</a>,
248-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/structs/LRUCache.js#L293">line 293</a>
248+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/structs/LRUCache.js#L296">line 296</a>
249249
</div>
250250

251251
</div>

dist/en/main/examples/common.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/offscreen-canvas.worker.worker.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/offscreen-canvas.worker.worker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/structs/LRUCache.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ declare class LRUCache<T> {
6464
* @type {?Entry}
6565
*/
6666
private newest_;
67+
deleteOldest(): void;
6768
/**
6869
* @return {boolean} Can expire cache.
6970
*/

dist/en/main/ol/structs/LRUCache.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/structs/LRUCache.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ class LRUCache {
5959
this.newest_ = null;
6060
}
6161

62+
deleteOldest() {
63+
const entry = this.pop();
64+
if (entry instanceof Disposable) {
65+
entry.dispose();
66+
}
67+
}
68+
6269
/**
6370
* @return {boolean} Can expire cache.
6471
*/
@@ -73,21 +80,17 @@ class LRUCache {
7380
*/
7481
expireCache(keep) {
7582
while (this.canExpireCache()) {
76-
const entry = this.pop();
77-
if (entry instanceof Disposable) {
78-
entry.dispose();
79-
}
83+
this.deleteOldest();
8084
}
8185
}
8286

8387
/**
8488
* FIXME empty description for jsdoc
8589
*/
8690
clear() {
87-
this.count_ = 0;
88-
this.entries_ = {};
89-
this.oldest_ = null;
90-
this.newest_ = null;
91+
while (this.oldest_) {
92+
this.deleteOldest();
93+
}
9194
}
9295

9396
/**

0 commit comments

Comments
 (0)