Fixed the bug that erase_rotate_recur() erases parent node.

This commit is contained in:
Tatsuhiro Tsujikawa 2012-05-19 00:49:15 +09:00
parent f96c7f8720
commit 3be09efbde
1 changed files with 4 additions and 2 deletions

View File

@ -159,10 +159,12 @@ static spdylay_map_entry* erase_rotate_recur(spdylay_map_entry *entry)
return left;
} else if(entry->left->priority < entry->right->priority) {
entry = rotate_right(entry);
return erase_rotate_recur(entry->right);
entry->right = erase_rotate_recur(entry->right);
return entry;
} else {
entry = rotate_left(entry);
return erase_rotate_recur(entry->left);
entry->left = erase_rotate_recur(entry->left);
return entry;
}
}