From 6dc8c982375be674ab9ea52345afc70cf0bd60c8 Mon Sep 17 00:00:00 2001 From: Guillaume Bittoun Date: Fri, 10 Oct 2014 19:07:07 +0000 Subject: [PATCH] avl_tree: tiny optimisation --- src/lol/algorithm/avl_tree.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lol/algorithm/avl_tree.h b/src/lol/algorithm/avl_tree.h index 88fd1b6e..463f1552 100644 --- a/src/lol/algorithm/avl_tree.h +++ b/src/lol/algorithm/avl_tree.h @@ -130,12 +130,10 @@ protected: if (key < this->m_key) { this->m_child[0]->increase_path(key); - this->compute_balance(); } if (this->m_key < key) { this->m_child[1]->increase_path(key); - this->compute_balance(); } } @@ -190,33 +188,25 @@ protected: void rotateLL() { tree_node * newhead = this->m_child[0]->rotate(CCW); - this->m_child[0] = newhead; - this->compute_balance(); } void rotateLR() { tree_node * newhead = this->m_child[0]->rotate(CW); - this->m_child[0] = newhead; - this->compute_balance(); } void rotateRL() { tree_node * newhead = this->m_child[1]->rotate(CCW); - this->m_child[1] = newhead; - this->compute_balance(); } void rotateRR() { tree_node * newhead = this->m_child[1]->rotate(CW); - this->m_child[1] = newhead; - this->compute_balance(); } enum Rotation { CW = 0, CCW = 1 };