Medusa\Tree\PersistentAvlTree::remove PHP Method

remove() public method

public remove ( $key )
    public function remove($key)
    {
        $c = $this->compare($this->key, $key);
        if ($c === 0) {
            $t = $this->removeCurrentNode();
        } else {
            if ($c > 0) {
                $t = new self($this->key, $this->value, $this->left, $this->right->remove($this->key));
            } else {
                $t = new self($this->key, $this->value, $this->left->remove($this->key), $this->right);
            }
        }
        return $this->makeBalanced($t);
    }