From 3320687691fd65f50c61e9e67334a8f15da29eeb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 14 Nov 2006 01:06:15 +0000 Subject: [PATCH] improve enumerate so arbitrary ranges can be enumerated quickly Originally committed as revision 7033 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavutil/tree.c b/libavutil/tree.c index aff749e791..f0a9145ce1 100644 --- a/libavutil/tree.c +++ b/libavutil/tree.c @@ -93,9 +93,9 @@ void av_tree_destroy(AVTreeNode *t){ #if 0 void av_tree_enumerate(AVTreeNode *t, void *opaque, int (*f)(void *opaque, void *elem)){ - f(opaque, t->elem); - av_tree_enumerate(t->child[0], opaque, f); - av_tree_enumerate(t->child[1], opaque, f); + int v= f(opaque, t->elem); + if(v>=0) av_tree_enumerate(t->child[0], opaque, f); + if(v<=0) av_tree_enumerate(t->child[1], opaque, f); } #endif