java-cons

This small, one interface project is a try to reimplement the mechanics used in Rackets cons cells in Java.
git clone git://git.oshgnacknak.de/java-cons.git
Log | Files | Refs | README

commit 6b05521344b6683cf9af52679f470aea1e258a9e
parent f2cd791f6e84b2b11ae4c9b261ad036b08dd0fd6
Author: Oshgnacknak <osh@oshgnacknak.de>
Date:   Fri, 15 Jan 2021 00:28:18 +0100

Remove redundant filter

Diffstat:
Msrc/NonEmpty.java | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/NonEmpty.java b/src/NonEmpty.java @@ -32,7 +32,7 @@ public class NonEmpty<V> implements Cons<V> { public Cons<V> filter(Predicate<V> predicate) { var newRest = rest.filter(predicate); return predicate.test(first) ? - new NonEmpty<>(first, newRest.filter(predicate)) : + new NonEmpty<>(first, newRest) : newRest; }