From 56546094c58f95fd829f2a61f87a564b14310581 Mon Sep 17 00:00:00 2001 From: alex-s168 <63254202+alex-s168@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:38:28 +0200 Subject: [PATCH] v0.12 --- README.md | 2 +- build.gradle.kts | 2 +- src/main/kotlin/blitz/async/Async.kt | 2 -- src/main/kotlin/blitz/collections/Search.kt | 2 +- src/main/kotlin/blitz/logic/Bools.kt | 6 +++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 11256f7..711b184 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ repositories { } dependencies { - implementation("me.alex_s168:blitz:0.11") + implementation("me.alex_s168:blitz:0.12") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index f08f4e6..4b2cdce 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { } group = "me.alex_s168" -version = "0.11" +version = "0.12" repositories { mavenCentral() diff --git a/src/main/kotlin/blitz/async/Async.kt b/src/main/kotlin/blitz/async/Async.kt index 54c9820..589c334 100644 --- a/src/main/kotlin/blitz/async/Async.kt +++ b/src/main/kotlin/blitz/async/Async.kt @@ -1,7 +1,5 @@ package blitz.async -import kotlin.random.Random - // TODO: use coroutines? fun async(fn: () -> R): Future { lateinit var future: ThreadWaitingFuture diff --git a/src/main/kotlin/blitz/collections/Search.kt b/src/main/kotlin/blitz/collections/Search.kt index a971c57..61e3767 100644 --- a/src/main/kotlin/blitz/collections/Search.kt +++ b/src/main/kotlin/blitz/collections/Search.kt @@ -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 > findElementComparing( diff --git a/src/main/kotlin/blitz/logic/Bools.kt b/src/main/kotlin/blitz/logic/Bools.kt index 30d8d40..452c73f 100644 --- a/src/main/kotlin/blitz/logic/Bools.kt +++ b/src/main/kotlin/blitz/logic/Bools.kt @@ -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 {