beagle r4494 - branches/beagle-rdf/beagled



Author: dbera
Date: Sun Feb 17 00:38:46 2008
New Revision: 4494
URL: http://svn.gnome.org/viewvc/beagle?rev=4494&view=rev

Log:
TermEnum is already positioned at the first term when created. No need to call Next() before accessing first term.


Modified:
   branches/beagle-rdf/beagled/LuceneCommon.cs

Modified: branches/beagle-rdf/beagled/LuceneCommon.cs
==============================================================================
--- branches/beagle-rdf/beagled/LuceneCommon.cs	(original)
+++ branches/beagle-rdf/beagled/LuceneCommon.cs	Sun Feb 17 00:38:46 2008
@@ -337,8 +337,11 @@
 				// http://mail-archives.apache.org/mod_mbox/lucene-java-user/200504.mbox/%3c4265767B 5090307 getopt org%3e
 				enumerator = reader.Terms ();
 
-				while (enumerator.Next ()) {
+				do {
 					Term term = enumerator.Term ();
+					if (term == null)
+						break;
+
 					positions = reader.TermPositions (term);
 
 					while (positions.Next ()) {
@@ -349,7 +352,7 @@
 					}
 					positions.Close ();
 					positions = null;
-				}
+				} while (enumerator.Next ());
 
 				enumerator.Close ();
 				enumerator = null;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]