diff --git a/Properties/Lazy property/src/Task.kt b/Properties/Lazy property/src/Task.kt index 4cd04be..8fb04ca 100644 --- a/Properties/Lazy property/src/Task.kt +++ b/Properties/Lazy property/src/Task.kt @@ -2,9 +2,6 @@ class LazyProperty(val initializer: () -> Int) { var value: Int? = null val lazy: Int get() { - if (value == null) { - value = initializer() - } - return value!! + return value ?: initializer().also { value = it } } } diff --git a/Properties/Lazy property/task-info.yaml b/Properties/Lazy property/task-info.yaml index 1411f30..0817a9b 100644 --- a/Properties/Lazy property/task-info.yaml +++ b/Properties/Lazy property/task-info.yaml @@ -7,7 +7,7 @@ files: length: 22 placeholder_text: /* TODO */ - offset: 122 - length: 99 + length: 49 placeholder_text: TODO() - name: test/tests.kt visible: false