fix finelist and add tests

This commit is contained in:
2021-01-02 17:23:22 +01:00
parent 3ad63eb3a8
commit 09d3d7a923
2 changed files with 38 additions and 4 deletions

View File

@@ -15,12 +15,10 @@ FineSet::FineSet() : Set("FineSet") { }
bool FineSet::add(int element) {
first->lock();
return true;
Node* p = this->first;
Node* c = p->next;
c->lock();
while (c->is_smaller_than(element)) {
std::cout << "C: "<< c->next << std::endl;
p->unlock();
p = c;
c = c->next;
@@ -42,7 +40,7 @@ bool FineSet::add(int element) {
}
}
bool FineSet::rmv(int element) {
bool FineSet::rmv(int element) {
this->first->lock();
Node* p = this->first;
Node* c = p->next;