79090518

Date: 2024-10-15 14:58:53
Score: 0.5
Natty:
Report link

You can replace this "by lazy" code

val lazyValue by lazy { runBlocking { getValue() } }
// usage: if (...) lazyValue else ...

with this:

val deferredValue = async(start = CoroutineStart.LAZY) { getValue() }
// usage: if (...) deferredValue.await() else ...
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Alex Elkin