lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject lucenenet git commit: BUG: Lucene.Net.Analysis.Common.Analysis.Payloads.FloatEncoder - parse float using invariant culture, or it won't be consistent
Date Thu, 02 Mar 2017 18:04:36 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/api-work 82ffd6a3e -> bf68997d4


BUG: Lucene.Net.Analysis.Common.Analysis.Payloads.FloatEncoder - parse float using invariant
culture, or it won't be consistent


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/bf68997d
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/bf68997d
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/bf68997d

Branch: refs/heads/api-work
Commit: bf68997d4bb588301e3f999febce27b42667c0ff
Parents: 82ffd6a
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Mar 3 01:00:21 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Mar 3 01:00:21 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/bf68997d/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
index 4810d9d..695a3fa 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
@@ -1,5 +1,6 @@
 ´╗┐using Lucene.Net.Util;
 using System;
+using System.Globalization;
 
 namespace Lucene.Net.Analysis.Payloads
 {
@@ -30,7 +31,7 @@ namespace Lucene.Net.Analysis.Payloads
     {
         public override BytesRef Encode(char[] buffer, int offset, int length)
         {
-            float payload = float.Parse(new string(buffer, offset, length)); //TODO: improve
this so that we don't have to new Strings
+            float payload = float.Parse(new string(buffer, offset, length), CultureInfo.InvariantCulture);
//TODO: improve this so that we don't have to new Strings
             byte[] bytes = PayloadHelper.EncodeSingle(payload);
             BytesRef result = new BytesRef(bytes);
             return result;


Mime
View raw message