/[RomCheater]/trunk/RomCheater/Serialization/SearchResultReader.cs
ViewVC logotype

Diff of /trunk/RomCheater/Serialization/SearchResultReader.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Serialization/SearchResultReader.cs	2013/06/04 20:33:40	507
+++ trunk/RomCheater/Serialization/SearchResultReader.cs	2013/06/04 21:16:35	508
@@ -147,6 +147,8 @@
                 {
                     // result the current entry (at position)
                     //throw new NotImplementedException(); 
+                    CheckIndexLessThanMin();
+                    CheckIndexGreaterThanMax();
                     return GetResultAtIndex(this.reader, this.index, this.unsigned, this.datatype, this.update_progress);
                 }
             }
@@ -163,20 +165,13 @@
 
             public bool MoveNext()
             {
-                //bool res = _enumerator.MoveNext();
-                //if (res) _index++;
-                //return res;
-
-                this.index++; // increment index
-                if (this.index >= MinimumIndex && this.index <= MaximumIndex)
+                if (this.index > MinimumIndex)
                 {
-                    this.index++;
-                    return true;
+                    this.index++; // increment after processing index at MinimumIndex
                 }
-                else
+                if(this.index >= this.MinimumIndex && this.index <= this.MaximumIndex)
                 {
-                    CheckIndexLessThanMin();
-                    CheckIndexGreaterThanMax();                 
+                    return true;
                 }
                 return false;
                 

 

  ViewVC Help
Powered by ViewVC 1.1.22