set grandpa's colour correctly

This commit is contained in:
jacekpoz 2024-06-06 00:01:41 +02:00
parent 2d8a36e932
commit 9941175a3c
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -293,7 +293,7 @@ impl RedBlackTree {
if !uncle.is_null() && uncle.colour() == Red {
uncle.set_colour(Black);
parent.set_colour(Black);
grandparent.set_colour(Black);
grandparent.set_colour(Red);
node = grandparent;
} else {
if parent.left() == node {