aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-07-31 23:32:46 +0200
committerGitHub <noreply@github.com>2024-07-31 23:32:46 +0200
commitd7e80759a90dd6c4b36a370113e2c81e78601dc6 (patch)
treee4899b418867163081202f1f970ed4579abe5844 /src/main/java/at/hannibal2/skyhanni/utils
parent2b722de68f5c17481ac4c24c03a2f952623be4a9 (diff)
downloadskyhanni-d7e80759a90dd6c4b36a370113e2c81e78601dc6.tar.gz
skyhanni-d7e80759a90dd6c4b36a370113e2c81e78601dc6.tar.bz2
skyhanni-d7e80759a90dd6c4b36a370113e2c81e78601dc6.zip
Feature: Price per Stock of Stonks (#2195)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt5
1 files changed, 5 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 80aa131b2..33e85e2fe 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/CollectionUtils.kt
@@ -143,6 +143,11 @@ object CollectionUtils {
return newList
}
+ inline fun <reified T, reified K : MutableList<T>> K.transformAt(index: Int, transform: T.() -> T): K {
+ this[index] = transform(this[index])
+ return this
+ }
+
/**
* This does not work inside a [buildList] block
*/