Author: mbenson
Date: Mon Jul 23 15:35:18 2007
New Revision: 558886

URL: http://svn.apache.org/viewvc?view=rev&rev=558886
Log:
should speed this filter somewhat

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java?view=diff&rev=558886&r1=558885&r2=558886
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/filters/HeadFilter.java Mon 
Jul 23 15:35:18 2007
@@ -62,6 +62,9 @@
     /** the position in the current line */
     private int       linePos   = 0;
 
+    /** Whether this filter is finished */
+    private boolean eof;
+
     /**
      * Constructor for "dummy" instances.
      *
@@ -107,6 +110,9 @@
                 return -1;
             }
             line = headFilter(line);
+            if (eof) {
+                return -1;
+            }
             linePos = 0;
         }
 
@@ -206,6 +212,7 @@
 
         if (lines > 0) {
             if (linesRead > (lines + skip)) {
+                eof = true;
                 return null;
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to