lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1084959 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs
Date Thu, 24 Mar 2011 13:55:30 GMT
Author: digy
Date: Thu Mar 24 13:55:29 2011
New Revision: 1084959

URL: http://svn.apache.org/viewvc?rev=1084959&view=rev
Log:
[LUCENENET-399] Some cleanup

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexFileDeleter.cs?rev=1084959&r1=1084958&r2=1084959&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexFileDeleter.cs Thu Mar 24 13:55:29
2011
@@ -72,7 +72,7 @@ namespace Lucene.Net.Index
 		/* Files that we tried to delete but failed (likely
 		* because they are open and we are running on Windows),
 		* so we will retry them again later: */
-		private System.Collections.IList deletable;
+		private System.Collections.Generic.IList<string> deletable;
 		
 		/* Reference count for all files in the index.  
 		* Counts how many existing commits reference a file.
@@ -407,7 +407,7 @@ namespace Lucene.Net.Index
 		{
 			if (deletable != null)
 			{
-				System.Collections.IList oldDeletable = deletable;
+				System.Collections.Generic.IList<string> oldDeletable = deletable;
 				deletable = null;
 				int size = oldDeletable.Count;
 				for (int i = 0; i < size; i++)
@@ -416,7 +416,7 @@ namespace Lucene.Net.Index
 					{
 						Message("delete pending file " + oldDeletable[i]);
 					}
-					DeleteFile((System.String) oldDeletable[i]);
+					DeleteFile(oldDeletable[i]);
 				}
 			}
 		}
@@ -539,21 +539,10 @@ namespace Lucene.Net.Index
 		
 		internal void  DecRef(System.Collections.Generic.ICollection<string> files)
 		{
-            if (files is System.Collections.Hashtable)
+            System.Collections.Generic.IEnumerator<string> it = files.GetEnumerator();
+            while (it.MoveNext())
             {
-				System.Collections.IEnumerator it = files.GetEnumerator();
-				while (it.MoveNext())
-				{
-				    DecRef((System.String) ((System.Collections.DictionaryEntry) it.Current).Key);
-			    }
-            }
-            else
-            {
-                System.Collections.IEnumerator it = files.GetEnumerator();
-                while (it.MoveNext())
-                {
-                    DecRef((System.String) it.Current);
-                }
+                DecRef(it.Current);
             }
 		}
 		
@@ -672,7 +661,7 @@ namespace Lucene.Net.Index
 					}
 					if (deletable == null)
 					{
-						deletable = new System.Collections.ArrayList();
+                        deletable = new System.Collections.Generic.List<string>();
 					}
 					deletable.Add(fileName); // add to deletable
 				}



Mime
View raw message