mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-22 16:47:15 +00:00
commit
ccc4d030c3
@ -1,5 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.4.11
|
||||
|
||||
* `Common`
|
||||
* Add `clamp` function
|
||||
|
||||
## 0.4.10
|
||||
|
||||
* `Versions`:
|
||||
|
@ -0,0 +1,10 @@
|
||||
package dev.inmo.micro_utils.common
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun <T : Comparable<T>> T.clamp(min: T, max: T): T {
|
||||
return when {
|
||||
this < min -> min
|
||||
this > max -> max
|
||||
else -> this
|
||||
}
|
||||
}
|
@ -40,5 +40,5 @@ dokka_version=1.4.20
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.4.10
|
||||
android_code_version=14
|
||||
version=0.4.11
|
||||
android_code_version=15
|
||||
|
Loading…
Reference in New Issue
Block a user