changeset 418:9f2461caf179 libavutil

Flip key and element so types match, not that it matters for any code using it in libav*.
author michael
date Fri, 04 Jan 2008 18:58:36 +0000
parents ba2d05538ec1
children 290f5853797a
files tree.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tree.c	Fri Jan 04 18:55:14 2008 +0000
+++ b/tree.c	Fri Jan 04 18:58:36 2008 +0000
@@ -32,10 +32,10 @@
 
 void *av_tree_find(const AVTreeNode *t, void *key, int (*cmp)(void *key, const void *b), void *next[2]){
     if(t){
-        unsigned int v= cmp(t->elem, key);
+        unsigned int v= cmp(key, t->elem);
         if(v){
-            if(next) next[(v>>31)^1]= t->elem;
-            return av_tree_find(t->child[v>>31], key, cmp, next);
+            if(next) next[v>>31]= t->elem;
+            return av_tree_find(t->child[(v>>31)^1], key, cmp, next);
         }else{
             if(next){
                 av_tree_find(t->child[0], key, cmp, next);