From 0818c415a90b41b73807e0fb8ec1462d4fed89a4 Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Fri, 15 Apr 2011 19:26:10 +0400 Subject: [PATCH] Simplification of NotNullLazyValue. --- .../src/com/intellij/openapi/util/NotNullLazyValue.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/platform/util/src/com/intellij/openapi/util/NotNullLazyValue.java b/platform/util/src/com/intellij/openapi/util/NotNullLazyValue.java index 1b82d50fdd18..9c9390371f87 100644 --- a/platform/util/src/com/intellij/openapi/util/NotNullLazyValue.java +++ b/platform/util/src/com/intellij/openapi/util/NotNullLazyValue.java @@ -23,17 +23,15 @@ import org.jetbrains.annotations.NotNull; * @author peter */ public abstract class NotNullLazyValue { - private boolean myComputed; - @NotNull private T myValue; + private T myValue; @NotNull protected abstract T compute(); @NotNull public T getValue() { - if (!myComputed) { + if (myValue == null) { myValue = compute(); - myComputed = true; } return myValue; }