KdTree::KdNode* KdTree::removeInternal(KdNode* node,VecItem* item,int cd){ if(node==0) return node; int next_d = (cd+1)%m_k; if( item==node->item){ if(node->right){ node->item = findMin(node->right,cd,next_d); node->right = removeInternal(node->right,node->item,next_d); }else{ if(node->left){ node->item = findMin(node->left,cd,next_d); node->left = removeInternal(node->left,node->item,next_d); }else{ delete node; m_size--; return 0; } } }else{ if( item->getPosition()[cd] < node->item->getPosition()[cd] ){ node->left = removeInternal(node->left,item,next_d); }else{ node->right = removeInternal(node->right,item,next_d); } } return node; }
void remove () { auto type = getComponentType<T>(); if (componentOperationHandler != nullptr && componentOperationHandler->isActive()) componentOperationHandler->remove(this, type); else removeInternal(type); }
void String::remove(unsigned position, int lengthToRemove) { if (lengthToRemove <= 0) return; if (position >= length()) return; if (static_cast<unsigned>(lengthToRemove) > length() - position) lengthToRemove = length() - position; if (is8Bit()) { removeInternal(characters8(), position, lengthToRemove); return; } removeInternal(characters16(), position, lengthToRemove); }
/** * * @brief removes all internal transitions to or from the given state * * @param - state: the state whose transitions to remove * @return false if no transitions were removed, true otherwise * */ bool TransitionStorage::removeInternalTransWith( State state ) { Internals outgoing = T_info.fromTrans(state); Internals incoming = T_info.toTrans(state); //Remove the transitions. for( InternalIterator rit = outgoing.begin(); rit != outgoing.end(); rit++ ) { removeInternal(*rit); } //Remove the transitions. for( InternalIterator rit = incoming.begin(); rit != incoming.end(); rit++ ) { removeInternal(*rit); } return (outgoing.size() > 0) || (incoming.size() > 0); }
bool DOMSettableTokenList::toggle(const AtomicString& token, ExceptionCode& ec) { if (!validateToken(token, ec)) return false; if (m_tokens.contains(token)) { removeInternal(token); return false; } addInternal(token); return true; }
bool DOMTokenList::toggle(const AtomicString& token, bool force, ExceptionState& exceptionState) { if (!validateToken(token, exceptionState)) return false; if (force) addInternal(token); else removeInternal(token); return force; }
bool DOMTokenList::toggle(const AtomicString& token, ExceptionState& exceptionState) { if (!validateToken(token, exceptionState)) return false; if (containsInternal(token)) { removeInternal(token); return false; } addInternal(token); return true; }
/** * Internal method to remove from a subtree. * x is the item to remove. * t is the node that roots the tree. * Set the new root. */ void BinarySearchTree::removeInternal (Customer * x, BinaryNode * &t) { if (t == NULL) return; // Item not found; do nothing if (x < t->element) removeInternal (x, t->left); else if (t->element < x) removeInternal (x, t->right); else if (t->left != NULL && t->right != NULL) // Two children { t->element = findMin (t->right)->element; removeInternal (t->element, t->right); } else { BinaryNode *oldNode = t; t = (t->left != NULL) ? t->left : t->right; delete oldNode; } }
/** * * @brief removes all internal transitions with the given symbol * * @param - sym: the symbol whose transitions to remove * @return false if no transitions were removed, true otherwise * */ bool TransitionStorage::removeInternalTransSym( Symbol sym ) { Internals removeTrans; //Find transitions to remove. for( InternalIterator iit = internalTrans.begin(); iit != internalTrans.end(); iit++ ) { if( getInternalSym(*iit) == sym ) removeTrans.insert(*iit); } //Remove transitions. for( InternalIterator rit = removeTrans.begin(); rit != removeTrans.end(); rit++ ) { removeInternal(*rit); } return removeTrans.size() > 0; }
void EntityEngine::processPendingComponentOperations() { for (auto componentOperation : componentOperations) { auto entity = componentOperation->entity; auto component = componentOperation->component; auto componentId = componentOperation->componentId; switch (componentOperation->type) { case ComponentOperation::ADD: entity->addInternal(component, componentId); break; case ComponentOperation::REMOVE: entity->removeInternal(componentId); break; } updateFamilyMembership(entity); } componentOperations.clear(); }
void DOMSettableTokenList::remove(const AtomicString& token, ExceptionCode& ec) { if (!validateToken(token, ec) || !m_tokens.contains(token)) return; removeInternal(token); }
void DOMTokenList::remove(const WTF::AtomicString& token, ExceptionCode& ec) { removeInternal(&token.string(), 1, ec); }
void DOMTokenList::remove(const Vector<String>& tokens, ExceptionCode& ec) { removeInternal(tokens.data(), tokens.size(), ec); }
void KdTree::removeItem(VecItem* item){ m_root = removeInternal(m_root,item,0); }
/** * Remove x from the tree. Nothing is done if x is not found. */ void BinarySearchTree::remove (Customer * x) { removeInternal (x, root); }
/** * * @brief remove an internal transition from the NWA * * @param - from: the state the edge departs from * @param - sym: the symbol labeling the edge * @param - to: the state the edge arrives to * @return false if the internal transition does not exist in the NWA * */ bool TransitionStorage::removeInternal( State from, Symbol sym, State to ) { Internal it(from,sym,to); return removeInternal(it); }