summaryrefslogtreecommitdiff
path: root/meta2
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-10-04 05:12:22 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-10-04 05:12:22 +0000
commit573e3c67a9f113b2bd101c669b1b86615356fc13 (patch)
tree21a5e0a23f231eef3a12f13feb5c4e29167047ab /meta2
parent57076d297233ecc7f2654a31086c0ff339284071 (diff)
fix to binary tree delete...again!
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@352 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'meta2')
-rw-r--r--meta2/collection.h8
-rw-r--r--meta2/version.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/meta2/collection.h b/meta2/collection.h
index 9067158..2c69216 100644
--- a/meta2/collection.h
+++ b/meta2/collection.h
@@ -321,7 +321,7 @@ public:
virtual ~TreeNode() {
if(parent) {
if(parent->left == this) parent->left = 0;
- else parent->right = 0;
+ if(parent->right == this)parent->right = 0;
}
}
};
@@ -340,20 +340,18 @@ protected:
return n;
} else if(n->right) {
if(n->parent) {
- if(n->parent->left = n) n->parent->left = n->right;
+ if(n->parent->left == n) n->parent->left = n->right;
else n->parent->right = n->right;
} else
root = n->right;
n->right->parent = n->parent;
- n->parent = 0; // don't mess with pointers
} else if(n->left) {
if(n->parent) {
- if(n->parent->left = n) n->parent->left = n->left;
+ if(n->parent->left == n) n->parent->left = n->left;
else n->parent->right = n->left;
} else
root = n->left;
n->left->parent = n->parent;
- n->parent = 0; // don't mess with pointers
} else {
if(n == root) root = 0;
}
diff --git a/meta2/version.h b/meta2/version.h
index f8e3ee7..3c62707 100644
--- a/meta2/version.h
+++ b/meta2/version.h
@@ -5,7 +5,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 0
-#define __BUILD_NUM 6
+#define __BUILD_NUM 7
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM