void bag::operator -=(const bag& subend) { node *copy_head_ptr; node *copy_tail_ptr; if (subend.many_nodes > 0) { list_copy(subend.head_ptr, copy_head_ptr, copy_tail_ptr); size_type a = subend.many_nodes; for (node *cursor = copy_head_ptr; cursor != NULL; cursor = cursor->link()) { erase_one(cursor->data()); } } }
void bag::operator -=(const bag & subtrahend) { node *copy_head_ptr; node *copy_tail_ptr; if(subtrahend.many_nodes > 0) { list_copy(subtrahend.head_ptr, copy_head_ptr, copy_tail_ptr); for(int i = 1; i <= list_length(copy_head_ptr); i++) { value_type val = list_locate(copy_head_ptr, i)->data(); erase_one(val); } } }
bool clear(data_buffer& buffer, index123_type& index123) { for (int i = 0; i < TEST_COUNT; ) { if ( erase_one(buffer, index123) ) { ++i; if (i%1000 == 0) { if( !check(buffer, index123) ) { return false; } } } } return true; }
bool stress(data_buffer& buffer, index123_type& index123, int count) { for(int i =0 ; i < count && index123.size() > 1; i++) { erase_one(buffer, index123); if (i % 100 == 0) { if( !check(buffer, index123) ) { return false; } } create_one(buffer, index123); if (i % 100 == 0) { if( !check(buffer, index123) ) { return false; } } } return true; }