diff options
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() + } } |