mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
extensions: add unsafeLazy
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
4bc023ce3b
commit
6388bc7ac9
@ -75,3 +75,6 @@ val RevCommit.time: Date
|
||||
fun String.splitLines(): Array<String> {
|
||||
return split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
}
|
||||
|
||||
/** Alias to [lazy] with thread safety mode always set to [LazyThreadSafetyMode.NONE]. */
|
||||
fun <T> unsafeLazy(initializer: () -> T) = lazy(LazyThreadSafetyMode.NONE) { initializer.invoke() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user