Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
better elvis
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnoJo4 committed Feb 9, 2020
1 parent 0958119 commit 3b22a0f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import okhttp3.RequestBody.Companion.toRequestBody
* ====================================================================
*/
/**
* com.github.doomsdayrs.api.shosetsu.extensions.lang.en
* 20 / January / 2020
* shosetsu-services
* 2020-01-20
*
* @author github.com/technojo4
*/
Expand Down Expand Up @@ -73,10 +73,9 @@ class ShosetsuLib : TwoArgFunction() {
}

fun Require(name: String): LuaValue?
= libraries[name] ?: run {
val v = libLoader(name)!!
libraries[name] = v; v
} ?: throw LuaError("Missing Library:\n\t\t$name")
= libraries[name] ?: with (libLoader(name)) {
libraries[name] = this ?: throw LuaError("Missing Library:\n\t\t$name"); this
}


// For normal extensions, these simple functions are sufficient.
Expand Down

0 comments on commit 3b22a0f

Please sign in to comment.