From 094ce8c00701f971173c81c93868a35d5f214659 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 17 Dec 2023 22:55:50 -0800 Subject: style(stores): simplify --- src/stores/lastPruneTimes.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/stores/lastPruneTimes.ts b/src/stores/lastPruneTimes.ts index aa2ab723..7f3a8b8d 100644 --- a/src/stores/lastPruneTimes.ts +++ b/src/stores/lastPruneTimes.ts @@ -34,15 +34,9 @@ const createStore = () => { const keys = Object.keys(defaultTimes); const lastPruneTimesKeys = Object.keys(state); - if (keys.length !== lastPruneTimesKeys.length) { - return defaultTimes; - } - - for (const key of keys) { - if (!lastPruneTimesKeys.includes(key)) { - return defaultTimes; - } - } + if (keys.length !== lastPruneTimesKeys.length) return defaultTimes; + + for (const key of keys) if (!lastPruneTimesKeys.includes(key)) return defaultTimes; return state; }, -- cgit v1.2.3