Revision 2e1d2873

View differences:

libavutil/tree.c
32 32

  
33 33
void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const void *b), void *next[2]){
34 34
    if(t){
35
        unsigned int v= cmp(t->elem, key);
35
        unsigned int v= cmp(key, t->elem);
36 36
        if(v){
37
            if(next) next[(v>>31)^1]= t->elem;
38
            return av_tree_find(t->child[v>>31], key, cmp, next);
37
            if(next) next[v>>31]= t->elem;
38
            return av_tree_find(t->child[(v>>31)^1], key, cmp, next);
39 39
        }else{
40 40
            if(next){
41 41
                av_tree_find(t->child[0], key, cmp, next);

Also available in: Unified diff