lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [7/7] git commit: Clean up
Date Tue, 16 Sep 2014 20:20:55 GMT
Clean up


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

Branch: refs/heads/master
Commit: 8452d3099d136d0c4d9565068c656bd52e08f740
Parents: e2f44e8
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Tue Sep 16 21:30:29 2014 +0300
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Tue Sep 16 21:30:29 2014 +0300

----------------------------------------------------------------------
 src/Lucene.Net.Core/Document/FloatDocValuesField.cs |  4 ++--
 src/Lucene.Net.Core/Support/Number.cs               |  7 ++++++-
 src/Lucene.Net.Core/Support/Single.cs               | 15 ---------------
 3 files changed, 8 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8452d309/src/Lucene.Net.Core/Document/FloatDocValuesField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Document/FloatDocValuesField.cs b/src/Lucene.Net.Core/Document/FloatDocValuesField.cs
index 704fb35..8e8d7bb 100644
--- a/src/Lucene.Net.Core/Document/FloatDocValuesField.cs
+++ b/src/Lucene.Net.Core/Document/FloatDocValuesField.cs
@@ -43,7 +43,7 @@ namespace Lucene.Net.Documents
         /// <param name="value"> 32-bit float value </param>
         /// <exception cref="ArgumentException"> if the field name is null </exception>
         public FloatDocValuesField(string name, float value)
-            : base(name, Support.Single.FloatToIntBits(value))
+            : base(name, Support.Number.FloatToIntBits(value))
         {
         }
 
@@ -51,7 +51,7 @@ namespace Lucene.Net.Documents
         {
             set
             {
-                base.LongValue = Support.Single.FloatToIntBits(value);
+                base.LongValue = Support.Number.FloatToIntBits(value);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8452d309/src/Lucene.Net.Core/Support/Number.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Number.cs b/src/Lucene.Net.Core/Support/Number.cs
index 3e0c7e4..2738278 100644
--- a/src/Lucene.Net.Core/Support/Number.cs
+++ b/src/Lucene.Net.Core/Support/Number.cs
@@ -394,7 +394,7 @@ namespace Lucene.Net.Support
 
         public static string ToBinaryString(int value)
         {
-            System.Text.StringBuilder sb = new System.Text.StringBuilder();
+            var sb = new System.Text.StringBuilder();
 
             var uval = (uint)value;
 
@@ -421,6 +421,11 @@ namespace Lucene.Net.Support
             return BitConverter.ToInt32(BitConverter.GetBytes(value), 0);
         }
 
+        public static long FloatToLongBits(float value)
+        {
+            return BitConverter.ToInt64(BitConverter.GetBytes(value), 0);
+        }
+
         //Flips the endianness from Little-Endian to Big-Endian
 
         //2 bytes

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8452d309/src/Lucene.Net.Core/Support/Single.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Single.cs b/src/Lucene.Net.Core/Support/Single.cs
index 7505828..edac46f 100644
--- a/src/Lucene.Net.Core/Support/Single.cs
+++ b/src/Lucene.Net.Core/Support/Single.cs
@@ -117,20 +117,5 @@ namespace Lucene.Net.Support
         {
             return f.ToString(format).Replace(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator,
".");
         }
-
-        public static int FloatToIntBits(float value)
-        {
-            return BitConverter.ToInt32(BitConverter.GetBytes(value), 0);
-        }
-
-        public static long FloatToLongBits(float value)
-        {
-            return BitConverter.ToInt64(BitConverter.GetBytes(value), 0);
-        }
-
-        public static float IntBitsToFloat(int value)
-        {
-            return BitConverter.ToSingle(BitConverter.GetBytes(value), 0);
-        }
     }
 }
\ No newline at end of file


Mime
View raw message