mirror of https://github.com/apache/lucene.git
LUCENE-2438: don't pre-allocate before UTF16TOUTF8
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@940525 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c79ee4c70
commit
9b9a365bd0
|
@ -86,7 +86,7 @@ public class CompressionTools {
|
|||
* compressionLevel (constants are defined in
|
||||
* java.util.zip.Deflater). */
|
||||
public static byte[] compressString(String value, int compressionLevel) {
|
||||
BytesRef result = new BytesRef(10);
|
||||
BytesRef result = new BytesRef();
|
||||
UnicodeUtil.UTF16toUTF8(value, 0, value.length(), result);
|
||||
return compress(result.bytes, 0, result.length, compressionLevel);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class PHPSerializedWriter extends JSONWriter {
|
|||
public PHPSerializedWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp, boolean CESU8) {
|
||||
super(writer, req, rsp);
|
||||
this.CESU8 = CESU8;
|
||||
this.utf8 = CESU8 ? null : new BytesRef(10);
|
||||
this.utf8 = CESU8 ? null : new BytesRef();
|
||||
// never indent serialized PHP data
|
||||
doIndent = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue