v0.12
This commit is contained in:
@@ -12,7 +12,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("me.alex_s168:blitz:0.11")
|
||||
implementation("me.alex_s168:blitz:0.12")
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "me.alex_s168"
|
||||
version = "0.11"
|
||||
version = "0.12"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@@ -1,7 +1,5 @@
|
||||
package blitz.async
|
||||
|
||||
import kotlin.random.Random
|
||||
|
||||
// TODO: use coroutines?
|
||||
fun <R> async(fn: () -> R): Future<R> {
|
||||
lateinit var future: ThreadWaitingFuture<R>
|
||||
|
@@ -4,7 +4,7 @@ import kotlin.math.max
|
||||
|
||||
object Search {
|
||||
/**
|
||||
* Find a element by comparing.
|
||||
* Find an element by comparing.
|
||||
* Only works on sorted lists
|
||||
*/
|
||||
fun <T, C: Comparable<C>> findElementComparing(
|
||||
|
@@ -3,7 +3,7 @@ package blitz.logic
|
||||
/**
|
||||
* Execute a block if the boolean is true.
|
||||
*/
|
||||
fun Boolean.then(block: () -> Unit): Boolean {
|
||||
inline fun Boolean.then(block: () -> Unit): Boolean {
|
||||
if (this) {
|
||||
block()
|
||||
}
|
||||
@@ -14,7 +14,7 @@ fun Boolean.then(block: () -> Unit): Boolean {
|
||||
/**
|
||||
* Execute a block if the boolean is false.
|
||||
*/
|
||||
fun Boolean.otherwise(block: () -> Unit): Boolean {
|
||||
inline fun Boolean.otherwise(block: () -> Unit): Boolean {
|
||||
if (!this) {
|
||||
block()
|
||||
}
|
||||
@@ -25,7 +25,7 @@ fun Boolean.otherwise(block: () -> Unit): Boolean {
|
||||
/**
|
||||
* Execute a block if the boolean is true, otherwise execute another block.
|
||||
*/
|
||||
fun Boolean.then(block: () -> Unit, otherwise: () -> Unit): Boolean {
|
||||
inline fun Boolean.then(block: () -> Unit, otherwise: () -> Unit): Boolean {
|
||||
if (this) {
|
||||
block()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user