lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [45/50] [abbrv] lucenenet git commit: Lucene.Net.Core.Store.RAMFile refactor: Changed NumBuffers() > NumBuffers
Date Sun, 05 Mar 2017 11:49:24 GMT
Lucene.Net.Core.Store.RAMFile refactor: Changed NumBuffers() > NumBuffers


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

Branch: refs/heads/api-work
Commit: 59ebea07b3a8a3aeb43551002320428461b188e1
Parents: 72ffc53
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Mar 5 16:37:40 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Mar 5 17:08:51 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Store/RAMFile.cs         | 9 ++++++---
 src/Lucene.Net.Core/Store/RAMInputStream.cs  | 2 +-
 src/Lucene.Net.Core/Store/RAMOutputStream.cs | 4 ++--
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/59ebea07/src/Lucene.Net.Core/Store/RAMFile.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RAMFile.cs b/src/Lucene.Net.Core/Store/RAMFile.cs
index 36d118c..cc8e87e 100644
--- a/src/Lucene.Net.Core/Store/RAMFile.cs
+++ b/src/Lucene.Net.Core/Store/RAMFile.cs
@@ -83,11 +83,14 @@ namespace Lucene.Net.Store
             }
         }
 
-        protected internal int NumBuffers()
+        protected internal int NumBuffers
         {
-            lock (this)
+            get
             {
-                return m_buffers.Count;
+                lock (this)
+                {
+                    return m_buffers.Count;
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/59ebea07/src/Lucene.Net.Core/Store/RAMInputStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RAMInputStream.cs b/src/Lucene.Net.Core/Store/RAMInputStream.cs
index b76b48f..78d34d2 100644
--- a/src/Lucene.Net.Core/Store/RAMInputStream.cs
+++ b/src/Lucene.Net.Core/Store/RAMInputStream.cs
@@ -96,7 +96,7 @@ namespace Lucene.Net.Store
         private void SwitchCurrentBuffer(bool enforceEOF)
         {
             bufferStart = (long)BUFFER_SIZE * (long)currentBufferIndex;
-            if (currentBufferIndex >= file.NumBuffers())
+            if (currentBufferIndex >= file.NumBuffers)
             {
                 // end of file reached, no more buffers left
                 if (enforceEOF)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/59ebea07/src/Lucene.Net.Core/Store/RAMOutputStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/RAMOutputStream.cs b/src/Lucene.Net.Core/Store/RAMOutputStream.cs
index e809a30..23bde83 100644
--- a/src/Lucene.Net.Core/Store/RAMOutputStream.cs
+++ b/src/Lucene.Net.Core/Store/RAMOutputStream.cs
@@ -182,7 +182,7 @@ namespace Lucene.Net.Store
 
         private void SwitchCurrentBuffer()
         {
-            if (currentBufferIndex == file.NumBuffers())
+            if (currentBufferIndex == file.NumBuffers)
             {
                 currentBuffer = file.AddBuffer(BUFFER_SIZE);
             }
@@ -221,7 +221,7 @@ namespace Lucene.Net.Store
         /// Returns byte usage of all buffers. </summary>
         public virtual long SizeInBytes()
         {
-            return (long)file.NumBuffers() * (long)BUFFER_SIZE;
+            return (long)file.NumBuffers * (long)BUFFER_SIZE;
         }
 
         public override long Checksum


Mime
View raw message