diff options
author | ram@gw.udmsearch.izhnet.ru <> | 2002-05-28 20:46:35 +0500 |
---|---|---|
committer | ram@gw.udmsearch.izhnet.ru <> | 2002-05-28 20:46:35 +0500 |
commit | 479b3b3f03b84eac2e6ff1c8cd1774eddd3c1571 (patch) | |
tree | aab3730731dbe350743bccbc64d54ce36728f718 /mysys/tree.c | |
parent | 4375d827dbe3c8a24656c234bdb2db472e54982d (diff) | |
download | mariadb-git-479b3b3f03b84eac2e6ff1c8cd1774eddd3c1571.tar.gz |
Removed unnecessary key search in the hp_rb_write_key() function
Diffstat (limited to 'mysys/tree.c')
-rw-r--r-- | mysys/tree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mysys/tree.c b/mysys/tree.c index 1bd49ef5182..489262fcdc7 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -86,6 +86,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit, tree->custom_arg = custom_arg; tree->null_element.colour=BLACK; tree->null_element.left=tree->null_element.right=0; + tree->flag= 0; if (!free_element && size >= 0 && ((uint) size <= sizeof(void*) || ((uint) size & (sizeof(void*)-1)))) { @@ -231,7 +232,11 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size, rb_insert(tree,parent,element); /* rebalance tree */ } else + { + if (tree->flag & TREE_NO_DUPS) + return(NULL); element->count++; + } DBUG_EXECUTE("check_tree", test_rb_tree(tree->root);); return element; } |