mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-26 03:58:50 +00:00
add data docs
This commit is contained in:
parent
1f971117bd
commit
be33a130d3
@ -1,4 +1,12 @@
|
|||||||
package com.insanusmokrassar.krontab.utils
|
package com.insanusmokrassar.krontab.utils
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return [min] in case if [this] less than [min]. Otherwise will check that [max] grant than [this] and return [this]
|
||||||
|
* if so or [max] otherwise
|
||||||
|
*/
|
||||||
internal fun Int.clamp(min: Int, max: Int): Int = if (this < min) min else if (this > max) max else this
|
internal fun Int.clamp(min: Int, max: Int): Int = if (this < min) min else if (this > max) max else this
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper function for [clamp] extension
|
||||||
|
*/
|
||||||
internal fun Int.clamp(range: IntRange): Int = clamp(range.first, range.last)
|
internal fun Int.clamp(range: IntRange): Int = clamp(range.first, range.last)
|
||||||
|
Loading…
Reference in New Issue
Block a user