static void _proper_drop(adict_t*adict_p,adict_node_t*search_p){ if(!search_p){ return; } adict_node_t*parent_p=search_p->prev_p; if(parent_p){ if(parent_p->left_p == search_p){ parent_p->left_p=NULL; } else if(parent_p->rght_p == search_p){ parent_p->rght_p=NULL; } }else{ adict_p->root_p=search_p; } if(search_p->left_p){ search_p->left_p->prev_p=parent_p; } if(search_p->rght_p){ search_p->rght_p->prev_p=parent_p; } _drop(search_p); }
void Simulator::run() { if(isComplete()) { return; } std::string command; while(!_commands.empty()) { command = _commands.front(); //end of line if(command == "") { _commands.pop_front(); _drop(); break; } //print out current command std::cout << command << " "; try { _runOnce(command); } catch (const std::invalid_argument& arg) { std::cerr<< "\n" << "Invalid command: " << arg.what() << "\n Exiting!" << std::endl; exit(EXIT_FAILURE); } //on to next command _commands.pop_front(); } //new line for output formatting std::cout << std::endl; if(_commands.empty()) { _endOfScript = true; } }
void adict_drop(adict_t*adict_p){ if(!adict_p){ return; } while(adict_p->root_p){ if(adict_p->root_p->left_p){ _rotate(adict_p,adict_p->root_p->left_p); }else{ adict_node_t*drop_p=adict_p->root_p; if((adict_p->root_p=adict_p->root_p->rght_p)){ adict_p->root_p->prev_p=NULL; } _drop(drop_p); } } free(adict_p); }
void _nip(){ _swap(); _drop(); }
Status WiredTigerKVEngine::dropSortedDataInterface( OperationContext* opCtx, const StringData& ident ) { _drop( ident ); return Status::OK(); }
Status WiredTigerKVEngine::dropRecordStore( OperationContext* opCtx, const StringData& ident ) { _drop( ident ); return Status::OK(); }