aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-04-30 18:16:05 +0200
committerGitHub <noreply@github.com>2024-04-30 18:16:05 +0200
commit249e02778ce9543afc515ee4c7b5a57e154ac61d (patch)
tree44412cbbf98c5aa370e50e6599861ff556b73c50 /src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
parent7f26ff46f3a537f1561b33d9bb513a81509f855b (diff)
downloadskyhanni-249e02778ce9543afc515ee4c7b5a57e154ac61d.tar.gz
skyhanni-249e02778ce9543afc515ee4c7b5a57e154ac61d.tar.bz2
skyhanni-249e02778ce9543afc515ee4c7b5a57e154ac61d.zip
Backend: Renderable scrollables (#886)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
index f538f2d53..df4f15e47 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
@@ -148,6 +148,9 @@ object CollectionUtils {
return this
}
+ operator fun IntRange.contains(range: IntRange): Boolean =
+ range.first in this && range.last in this
+
fun <E> MutableList<List<E>>.addAsSingletonList(text: E) {
add(Collections.singletonList(text))
}