From 79d3a4a47cbc1fcf17c77c6fc12ff826a3077bac Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Wed, 6 Apr 2016 13:50:00 -0400 Subject: Minor bugfixes/changes, as well as beginnings of CLI systems --- .../src/main/java/bjc/utils/data/lazy/LazyHolder.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'BJC-Utils2/src/main/java/bjc/utils/data') diff --git a/BJC-Utils2/src/main/java/bjc/utils/data/lazy/LazyHolder.java b/BJC-Utils2/src/main/java/bjc/utils/data/lazy/LazyHolder.java index 61a5956..4b8ed30 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/data/lazy/LazyHolder.java +++ b/BJC-Utils2/src/main/java/bjc/utils/data/lazy/LazyHolder.java @@ -40,18 +40,17 @@ public class LazyHolder implements IHolder, ILazy { if (heldValue == null) { return pendingActions.reduceAux(heldSource.get(), Function::apply, pendingTransform::apply); - } else { - return pendingActions.reduceAux(heldValue, - Function::apply, pendingTransform::apply); } + + return pendingActions.reduceAux(heldValue, + Function::apply, pendingTransform::apply); } } /** * List of queued actions to be performed on realized values */ - private FunctionalList> actions = - new FunctionalList<>(); + private FunctionalList> actions = new FunctionalList<>(); /** * The value internally held by this lazy holder @@ -148,10 +147,10 @@ public class LazyHolder implements IHolder, ILazy { if (heldSource != null) { // We're materialized if a value exists return heldValue == null; - } else { - // We're materialized by default - return true; } + + // We're materialized by default + return true; } @Override @@ -170,7 +169,7 @@ public class LazyHolder implements IHolder, ILazy { @Override public void applyPendingActions() { materialize(); - + actions.forEach((action) -> { heldValue = action.apply(heldValue); }); -- cgit v1.2.3