You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2022/10/17 03:11:52 UTC

[james-mime4j] 02/14: MIME4J-318 BufferedLineReaderInputStream: shift table can be reused

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-mime4j.git

commit e88d55b60a34b73a7eefc478a310d4616f01e350
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon Jun 20 11:57:09 2022 +0700

    MIME4J-318 BufferedLineReaderInputStream: shift table can be reused
---
 .../org/apache/james/mime4j/io/BufferedLineReaderInputStream.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java b/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
index 887c6262..64d4122b 100644
--- a/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
+++ b/core/src/main/java/org/apache/james/mime4j/io/BufferedLineReaderInputStream.java
@@ -41,6 +41,7 @@ public class BufferedLineReaderInputStream extends LineReaderInputStream {
     private byte[] buffer;
     private int bufpos;
     private int buflen;
+    private int[] shiftTable;
 
     private final int maxLineLen;
 
@@ -60,6 +61,7 @@ public class BufferedLineReaderInputStream extends LineReaderInputStream {
         this.buflen = 0;
         this.maxLineLen = maxLineLen;
         this.truncated = false;
+        this.shiftTable = new int[256];
     }
 
     public BufferedLineReaderInputStream(
@@ -244,7 +246,7 @@ public class BufferedLineReaderInputStream extends LineReaderInputStream {
             return -1;
         }
 
-        int[] shiftTable = new int[256];
+
         for (int i = 0; i < shiftTable.length; i++) {
             shiftTable[i] = pattern.length + 1;
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org