diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-06-09 11:49:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-09 11:49:53 +0200 |
commit | 72fbd51e2a87d6d70c3f576759c5cc07c280be0d (patch) | |
tree | 72aa30601d568f4adf909eaff513b57013b2f325 /src/main/java | |
parent | 7f593e59c872daffd64f91ac70f7f8689a590c27 (diff) | |
download | skyhanni-72fbd51e2a87d6d70c3f576759c5cc07c280be0d.tar.gz skyhanni-72fbd51e2a87d6d70c3f576759c5cc07c280be0d.tar.bz2 skyhanni-72fbd51e2a87d6d70c3f576759c5cc07c280be0d.zip |
Fix: chum bucket cache (#2043)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/TimeLimitedSet.kt | 4 |
1 files changed, 3 insertions, 1 deletions
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<T : Any>( fun clear() = cache.clear() - fun toSet(): Set<T> = cache.keys().toSet() + fun toSet(): Set<T> = cache.keys().let { keys -> + if (keys.isEmpty()) emptySet() else keys.toSet() + } } |