summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/main/java/bjc/utils/data/lazy
diff options
context:
space:
mode:
authorbculkin2442 <bjculkin@mix.wvu.edu>2016-04-06 13:50:00 -0400
committerbculkin2442 <bjculkin@mix.wvu.edu>2016-04-06 13:50:00 -0400
commit79d3a4a47cbc1fcf17c77c6fc12ff826a3077bac (patch)
treea69e533c558326d583b3aee891fc815208c7b650 /BJC-Utils2/src/main/java/bjc/utils/data/lazy
parent4355418164c44170cfb329fcbb7e6f1358c0e314 (diff)
Minor bugfixes/changes, as well as beginnings of CLI systems
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/data/lazy')
-rw-r--r--BJC-Utils2/src/main/java/bjc/utils/data/lazy/LazyHolder.java17
1 files changed, 8 insertions, 9 deletions
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<T> implements IHolder<T>, ILazy {
if (heldValue == null) {
return pendingActions.reduceAux(heldSource.get(),
Function<T, T>::apply, pendingTransform::apply);
- } else {
- return pendingActions.reduceAux(heldValue,
- Function<T, T>::apply, pendingTransform::apply);
}
+
+ return pendingActions.reduceAux(heldValue,
+ Function<T, T>::apply, pendingTransform::apply);
}
}
/**
* List of queued actions to be performed on realized values
*/
- private FunctionalList<Function<T, T>> actions =
- new FunctionalList<>();
+ private FunctionalList<Function<T, T>> actions = new FunctionalList<>();
/**
* The value internally held by this lazy holder
@@ -148,10 +147,10 @@ public class LazyHolder<T> implements IHolder<T>, 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<T> implements IHolder<T>, ILazy {
@Override
public void applyPendingActions() {
materialize();
-
+
actions.forEach((action) -> {
heldValue = action.apply(heldValue);
});