diff options
author | unknown <ram@gw.udmsearch.izhnet.ru> | 2002-05-28 20:46:35 +0500 |
---|---|---|
committer | unknown <ram@gw.udmsearch.izhnet.ru> | 2002-05-28 20:46:35 +0500 |
commit | c78685e0c27fd15933a1aaf2733c4035aadf4e0d (patch) | |
tree | aab3730731dbe350743bccbc64d54ce36728f718 /mysys | |
parent | c1f3be5bb5f70e5d0376f258b79ccffa5b2d9c2b (diff) | |
download | mariadb-git-c78685e0c27fd15933a1aaf2733c4035aadf4e0d.tar.gz |
Removed unnecessary key search in the hp_rb_write_key() function
Diffstat (limited to 'mysys')
-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; } |