From 9ffd80b3f69185f480231664dd1e973722b9e3ef Mon Sep 17 00:00:00 2001
From: Javier Spano <javierfspano@gmail.com>
Date: Tue, 1 Feb 2022 01:21:35 -0300
Subject: [PATCH] remove not-null assertion operator from Lazy property task

---
 Properties/Lazy property/src/Task.kt    | 5 +----
 Properties/Lazy property/task-info.yaml | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

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