lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [8/8] lucenenet git commit: Lucene.Net.Util.IntBlockPool.SliceReader refactor: EndOfSlice() > IsEndOfSlice (property)
Date Sun, 09 Apr 2017 13:08:55 GMT
Lucene.Net.Util.IntBlockPool.SliceReader refactor: EndOfSlice() > IsEndOfSlice (property)


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

Branch: refs/heads/api-work
Commit: 66524157a407cc5557e1f9275f2cba9573487d50
Parents: ca97656
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Apr 9 20:07:02 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Apr 9 20:07:02 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs   |  2 +-
 src/Lucene.Net.Memory/MemoryIndex.cs                     |  4 ++--
 .../Index/TestFlushByRamOrCountsPolicy.cs                |  2 +-
 src/Lucene.Net.Tests/Index/TestIntBlockPool.cs           |  4 ++--
 src/Lucene.Net/Util/IntBlockPool.cs                      | 11 +++++++----
 5 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/66524157/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
index 777e476..ca83d1a 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs
@@ -530,7 +530,7 @@ namespace Lucene.Net.Index.Memory
                 public override int NextPosition()
                 {
                     Debug.Assert(posUpto++ < freq_Renamed);
-                    Debug.Assert(!sliceReader.EndOfSlice(), " stores offsets : " + startOffset_Renamed);
+                    Debug.Assert(!sliceReader.IsEndOfSlice, " stores offsets : " + startOffset_Renamed);
                     if (outerInstance.outerInstance.storeOffsets)
                     {
                         int pos = sliceReader.ReadInt32();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/66524157/src/Lucene.Net.Memory/MemoryIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Memory/MemoryIndex.cs b/src/Lucene.Net.Memory/MemoryIndex.cs
index 9d4b551..d278ab9 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.cs
@@ -672,7 +672,7 @@ namespace Lucene.Net.Index.Memory
                     postingsReader.Reset(sliceArray.start[ord], sliceArray.end[ord]);
                     result.Append(" [");
                     int iters = storeOffsets ? 3 : 1;
-                    while (!postingsReader.EndOfSlice())
+                    while (!postingsReader.IsEndOfSlice)
                     {
                         result.Append("(");
 
@@ -685,7 +685,7 @@ namespace Lucene.Net.Index.Memory
                             }
                         }
                         result.Append(")");
-                        if (!postingsReader.EndOfSlice())
+                        if (!postingsReader.IsEndOfSlice)
                         {
                             result.Append(",");
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/66524157/src/Lucene.Net.Tests/Index/TestFlushByRamOrCountsPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestFlushByRamOrCountsPolicy.cs b/src/Lucene.Net.Tests/Index/TestFlushByRamOrCountsPolicy.cs
index 9aa5936..12f8be3 100644
--- a/src/Lucene.Net.Tests/Index/TestFlushByRamOrCountsPolicy.cs
+++ b/src/Lucene.Net.Tests/Index/TestFlushByRamOrCountsPolicy.cs
@@ -34,7 +34,7 @@ namespace Lucene.Net.Index
     using NUnit.Framework;
 
     [TestFixture]
-    public class TestFlushByRamOrCountsPolicy : LuceneTestCase
+    public class TestFlushByRamOrCountsPolicy : LuceneTestCase 
     {
 
         private static LineFileDocs LineDocFile;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/66524157/src/Lucene.Net.Tests/Index/TestIntBlockPool.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIntBlockPool.cs b/src/Lucene.Net.Tests/Index/TestIntBlockPool.cs
index 98fc2d2..0b59c83 100644
--- a/src/Lucene.Net.Tests/Index/TestIntBlockPool.cs
+++ b/src/Lucene.Net.Tests/Index/TestIntBlockPool.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Index
                 {
                     Assert.AreEqual(i, reader.ReadInt32());
                 }
-                Assert.IsTrue(reader.EndOfSlice());
+                Assert.IsTrue(reader.IsEndOfSlice);
                 if (Random().NextBoolean())
                 {
                     pool.Reset(true, false);
@@ -161,7 +161,7 @@ namespace Lucene.Net.Index
             {
                 Assert.AreEqual(values.ValueOffset + i, reader.ReadInt32());
             }
-            Assert.IsTrue(reader.EndOfSlice());
+            Assert.IsTrue(reader.IsEndOfSlice);
         }
 
         private class StartEndAndValues

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/66524157/src/Lucene.Net/Util/IntBlockPool.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/IntBlockPool.cs b/src/Lucene.Net/Util/IntBlockPool.cs
index 36acce2..18180e9 100644
--- a/src/Lucene.Net/Util/IntBlockPool.cs
+++ b/src/Lucene.Net/Util/IntBlockPool.cs
@@ -426,10 +426,13 @@ namespace Lucene.Net.Util
             /// method returns <code>true</code> <seealso cref="SliceReader#readInt()"/>
should not
             /// be called again on this slice.
             /// </summary>
-            public bool EndOfSlice() // LUCENENET TODO: API make property
+            public bool IsEndOfSlice
             {
-                Debug.Assert(upto + bufferOffset <= end);
-                return upto + bufferOffset == end;
+                get
+                {
+                    Debug.Assert(upto + bufferOffset <= end);
+                    return upto + bufferOffset == end;
+                }
             }
 
             /// <summary>
@@ -440,7 +443,7 @@ namespace Lucene.Net.Util
             /// <seealso cref= SliceReader#endOfSlice() </seealso>
             public int ReadInt32()
             {
-                Debug.Assert(!EndOfSlice());
+                Debug.Assert(!IsEndOfSlice);
                 Debug.Assert(upto <= limit);
                 if (upto == limit)
                 {


Mime
View raw message