lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1100946 - /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs
Date Mon, 09 May 2011 10:36:45 GMT
Author: digy
Date: Mon May  9 10:36:45 2011
New Revision: 1100946

URL: http://svn.apache.org/viewvc?rev=1100946&view=rev
Log:
[LUCENENET-412]

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs?rev=1100946&r1=1100945&r2=1100946&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Index/FieldsWriter.cs Mon May
 9 10:36:45 2011
@@ -58,6 +58,10 @@ namespace Lucene.Net.Index
 		private IndexOutput indexStream;
 		
 		private bool doClose;
+
+        //DIGY
+        //To avoid to call "System.Text.Encoding.GetEncoding("UTF-8")" repeatedly
+        private System.Text.Encoding defaultEncoding = System.Text.Encoding.GetEncoding("UTF-8");

 		
 		internal FieldsWriter(Directory d, System.String segment, FieldInfos fn)
 		{
@@ -270,7 +274,7 @@ namespace Lucene.Net.Index
 					}
 					else
 					{
-						byte[] x = System.Text.Encoding.GetEncoding("UTF-8").GetBytes(field.StringValue());
+						byte[] x = defaultEncoding.GetBytes(field.StringValue());
 						data = CompressionTools.Compress(x, 0, x.Length);
 					}
 					len = data.Length;



Mime
View raw message