417284 Precompiled regex in HttpField
This commit is contained in:
parent
857d534d8d
commit
4708c907c1
|
@ -21,6 +21,7 @@ package org.eclipse.jetty.http;
|
|||
import java.nio.ByteBuffer;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.jetty.util.ArrayTrie;
|
||||
import org.eclipse.jetty.util.BufferUtil;
|
||||
|
@ -100,7 +101,8 @@ public class HttpField
|
|||
CACHE.put(new HttpField(HttpHeader.AUTHORIZATION,(String)null));
|
||||
CACHE.put(new HttpField(HttpHeader.COOKIE,(String)null));
|
||||
}
|
||||
|
||||
|
||||
private final static Pattern __splitter = Pattern.compile("\\s*,\\s*");
|
||||
private final static byte[] __colon_space = new byte[] {':',' '};
|
||||
|
||||
private final HttpHeader _header;
|
||||
|
@ -153,10 +155,10 @@ public class HttpField
|
|||
if (value.equalsIgnoreCase(_value))
|
||||
return true;
|
||||
|
||||
String[] split = _value.split("\\s*,\\s*");
|
||||
for (String s : split)
|
||||
String[] split = __splitter.split(_value);
|
||||
for (int i = 0; split!=null && i < split.length; i++)
|
||||
{
|
||||
if (value.equalsIgnoreCase(s))
|
||||
if (value.equalsIgnoreCase(split[i]))
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue