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:
Yonik Seeley 2010-05-03 17:30:55 +00:00
parent 1c79ee4c70
commit 9b9a365bd0
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;
}