lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/2] lucenenet git commit: Cleanup
Date Mon, 29 Dec 2014 10:30:10 GMT
Cleanup


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

Branch: refs/heads/master
Commit: cb4bbe09469a05be6dc79d91a3b6e5da11eaf745
Parents: 6a5ab75
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Mon Dec 29 12:29:52 2014 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Mon Dec 29 12:29:52 2014 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cb4bbe09/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
index d6064f0..4c446f2 100644
--- a/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
+++ b/src/Lucene.Net.Core/Util/FieldCacheSanityChecker.cs
@@ -282,22 +282,21 @@ namespace Lucene.Net.Util
         /// </summary>
         private IList<object> GetAllDescendantReaderKeys(object seed)
         {
-            List<object> all = new List<object>(17); // will grow as we iter
-            all.Add(seed);
-            for (int i = 0; i < all.Count; i++)
+            var all = new List<object>(17) {seed}; // will grow as we iter
+            for (var i = 0; i < all.Count; i++)
             {
-                object obj = all[i];
+                var obj = all[i];
                 // TODO: We don't check closed readers here (as getTopReaderContext
                 // throws AlreadyClosedException), what should we do? Reflection?
-                IndexReader reader = obj as IndexReader;
+                var reader = obj as IndexReader;
                 if (reader != null)
                 {
                     try
                     {
-                        IList<IndexReaderContext> childs = reader.Context.Children;
+                        var childs = reader.Context.Children;
                         if (childs != null) // it is composite reader
                         {
-                            foreach (IndexReaderContext ctx in childs)
+                            foreach (var ctx in childs)
                             {
                                 all.Add(ctx.Reader.CoreCacheKey);
                             }


Mime
View raw message