Created
April 16, 2020 04:00
-
-
Save charlesmuchene/b53c1724b468c5d92893e2226fe95592 to your computer and use it in GitHub Desktop.
A function to create an un-synchronized lazy initialization of a property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Initialize lazily without thread synchronization | |
* | |
* @param initializer Initializer block | |
* @return [Lazy] instance | |
*/ | |
fun <T> lazyNone(initializer: () -> T): Lazy<T> = lazy(LazyThreadSafetyMode.NONE, initializer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment