From c053271df8e182f80e179ac8dd1c7c71a92cce4b Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Sat, 17 Feb 2018 07:54:01 +0100 Subject: [PATCH] tiny performance tweak --- src/main/org/apache/tools/ant/types/resources/AllButFirst.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/types/resources/AllButFirst.java b/src/main/org/apache/tools/ant/types/resources/AllButFirst.java index f6bcf4985..f49181bf1 100644 --- a/src/main/org/apache/tools/ant/types/resources/AllButFirst.java +++ b/src/main/org/apache/tools/ant/types/resources/AllButFirst.java @@ -42,7 +42,7 @@ public class AllButFirst extends SizeLimitCollection { @Override public synchronized int size() { - return (int) getResourceCollection().stream().skip(getValidCount()).count(); + return Math.max(getResourceCollection().size() - getValidCount(), 0); } }