Commit 2e1d2873 authored by Michael Niedermayer's avatar Michael Niedermayer

Flip key and element so types match, not that it matters for any code

using it in libav*.

Originally committed as revision 11404 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b57cb968
...@@ -32,10 +32,10 @@ const int av_tree_node_size = sizeof(AVTreeNode); ...@@ -32,10 +32,10 @@ const int av_tree_node_size = sizeof(AVTreeNode);
void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const void *b), void *next[2]){ void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const void *b), void *next[2]){
if(t){ if(t){
unsigned int v= cmp(t->elem, key); unsigned int v= cmp(key, t->elem);
if(v){ if(v){
if(next) next[(v>>31)^1]= t->elem; if(next) next[v>>31]= t->elem;
return av_tree_find(t->child[v>>31], key, cmp, next); return av_tree_find(t->child[(v>>31)^1], key, cmp, next);
}else{ }else{
if(next){ if(next){
av_tree_find(t->child[0], key, cmp, next); av_tree_find(t->child[0], key, cmp, next);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment