From 72fbd51e2a87d6d70c3f576759c5cc07c280be0d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Sun, 9 Jun 2024 11:49:53 +0200 Subject: Fix: chum bucket cache (#2043) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt index 242d06cf0..c0626fccb 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt @@ -23,5 +23,7 @@ class TimeLimitedSet( fun clear() = cache.clear() - fun toSet(): Set = cache.keys().toSet() + fun toSet(): Set = cache.keys().let { keys -> + if (keys.isEmpty()) emptySet() else keys.toSet() + } } -- cgit