return NULL;
}
+ _Key getFirstKey() {
+ return list->key;
+ }
+
bool contains(_Key key) {
return table->get(key)!=NULL;
}
void operator delete[](void *p, size_t size) {
_free(p);
}
-
private:
HashTable<_Key, LinkNode<_Key>*, _KeyInt, _Shift, _malloc, _calloc, _free, hash_function, equals> * table;
LinkNode<_Key> *list;
}
void Planner::processChanges() {
- ChangeIterator *cit=changeset->iterator();
- for(;cit->hasNext();) {
- MCChange *change=cit->next();
- cit->remove();
+ while(!changeset->isEmpty()) {
+ MCChange *change=changeset->getFirstKey();
+ if (change==NULL)
+ break;
+ changeset->remove(change);
if (completedset->contains(change)) {
delete change;
continue;
} else ASSERT(false);
completedset->add(change);
}
- delete cit;
- for(cit=completedset->iterator();cit->hasNext();) {
+ ChangeIterator *cit=completedset->iterator();
+
+ for(;cit->hasNext();) {
MCChange *change=cit->next();
cit->remove();
delete change;