[libgee] Fix fix_up method in the TreeSet and TreeMap implementations
- From: Didier Villevalois <dvillevalois src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgee] Fix fix_up method in the TreeSet and TreeMap implementations
- Date: Sun, 20 Sep 2009 15:42:44 +0000 (UTC)
commit c6cf6f9c71cf543a06ef4ac5f6459cf886cc549e
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date: Sat Sep 19 22:59:33 2009 +0200
Fix fix_up method in the TreeSet and TreeMap implementations
Fixes bug 595703.
gee/treemap.vala | 2 +-
gee/treeset.vala | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gee/treemap.vala b/gee/treemap.vala
index 054bf65..660e81c 100644
--- a/gee/treemap.vala
+++ b/gee/treemap.vala
@@ -277,7 +277,7 @@ public class Gee.TreeMap<K,V> : Gee.AbstractMap<K,V> {
if (is_black (node.left) && is_red (node.right)) {
rotate_left (ref node);
}
- if (is_red (node.left) && is_black (node.right)) {
+ if (is_red (node.left) && is_red (node.left.left)) {
rotate_right (ref node);
}
}
diff --git a/gee/treeset.vala b/gee/treeset.vala
index bddef09..c3aa9b9 100644
--- a/gee/treeset.vala
+++ b/gee/treeset.vala
@@ -108,7 +108,7 @@ public class Gee.TreeSet<G> : AbstractSet<G> {
if (is_black (node.left) && is_red (node.right)) {
rotate_left (ref node);
}
- if (is_red (node.left) && is_black (node.right)) {
+ if (is_red (node.left) && is_red (node.left.left)) {
rotate_right (ref node);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]