| 641 | } |
| 642 | |
| 643 | HashTable::~HashTable() |
| 644 | { |
| 645 | // See comment in the destructor of HashSet. |
| 646 | for (int i = 0; i < tableSize; i++) { |
| 647 | for (Node *n = table[i]; n; n = n->next) { |
| 648 | if (ownerOfValues) { |
| 649 | Object *value = ((KeyValuePair*)n)->value; |
| 650 | if (value) { |
| 651 | PRINTF ("- deleting value: %s\n", value->toString()); |
| 652 | delete value; |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | HashSet::Node *HashTable::createNode() |
| 660 | { |