Changed iterator behavior...It only iterates over the items in the set
[repair.git] / Repair / RepairCompiler / MCC / Runtime / SimpleHash.cc
index d420a1c3934481809934c67d073c10c117be9010..2f8370c5e3f2817f82ef9dba982b1addf32b5799 100755 (executable)
@@ -137,13 +137,15 @@ void WorkList::add(int id,int type, int lvalue, int rvalue) {
 
 /* SIMPLE HASH ********************************************************/
 SimpleIterator* SimpleHash::iterator() {
-  return new SimpleIterator(listhead,this);
+  return new SimpleIterator(listhead,listtail,tailindex/*,this*/);
 }
 
 void SimpleHash::iterator(SimpleIterator & it) {
-  it.table=this;
+  //  it.table=this;
   it.cur=listhead;
   it.index=0;
+  it.tailindex=tailindex;
+  it.tail=listtail;
 }
 
 SimpleHash::SimpleHash(int size) {