mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-05 08:09:33 +00:00
@@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.4.11
|
||||||
|
|
||||||
|
* `Common`
|
||||||
|
* Add `clamp` function
|
||||||
|
|
||||||
## 0.4.10
|
## 0.4.10
|
||||||
|
|
||||||
* `Versions`:
|
* `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
|
# Project data
|
||||||
|
|
||||||
group=dev.inmo
|
group=dev.inmo
|
||||||
version=0.4.10
|
version=0.4.11
|
||||||
android_code_version=14
|
android_code_version=15
|
||||||
|
Reference in New Issue
Block a user