mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-14 00:16:21 +00:00
perf: SimpleDataStore
This commit is contained in:
parent
8a1ff434d9
commit
39aaa25f3f
@ -52,14 +52,14 @@ class SimpleDataStore {
|
||||
}
|
||||
|
||||
getStalest () {
|
||||
let stalest = null
|
||||
let stalest = [null, { stratval: Infinity }]
|
||||
switch (this.#strategy) {
|
||||
// both "lastGetTime" and "getsCount" simply must find lowest value
|
||||
// to determine the stalest entry
|
||||
case STRATEGIES[0]:
|
||||
case STRATEGIES[1]:
|
||||
for (const entry of this.#store) {
|
||||
if (!stalest || entry[1].stratval < stalest[1].stratval) {
|
||||
if (entry[1].stratval < stalest[1].stratval) {
|
||||
stalest = entry
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user