From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <ffmpeg-devel-bounces@ffmpeg.org> Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 081964CF26 for <ffmpegdev@gitmailbox.com>; Tue, 15 Apr 2025 18:15:22 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 39F34687D4B; Tue, 15 Apr 2025 21:14:46 +0300 (EEST) Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B799F687D24 for <ffmpeg-devel@ffmpeg.org>; Tue, 15 Apr 2025 21:14:37 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 028044328C for <ffmpeg-devel@ffmpeg.org>; Tue, 15 Apr 2025 18:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1744740877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=633Q/V9JA3eesMn8WybhWPK9CnSEhYFpzDMYTjtwXRQ=; b=Uaw41kRjY9mXqx7mUBTGWvSMKLPMrNmlRjkqIGt7AD9PXFnFjJp3Qv+YgWMvQtilfc/ym+ AdgYqDDklqclmbL7lcJ3JBJdmSs6jvOe3CR5YMQVNfflRSXK95NPqAOW4J54g08fafEWqw qw8zw02dP14rWG3RJMzVlofi580tAJG75i2pdPofZg51PRaI5wqTNmnl88Su8+48FXvOfU 9/00t5QhzCLJxXg/389D46RUjC0Y7bIUhgNJJD7d2+Zr3RiUdN23Qc9aqaGO5W3+cDHNNQ 5pQKctgyR11d71BKH0cDQTfSO89N3zuGXyJo5d5acv7/zwaYjU26m41mWXLZVg== From: Michael Niedermayer <michael@niedermayer.cc> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Date: Tue, 15 Apr 2025 20:14:31 +0200 Message-ID: <20250415181433.530161-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250415181433.530161-1-michael@niedermayer.cc> References: <20250415181433.530161-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdegudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdeftddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpedvgfefudeijeetieejkefgfffhtdeludeuffdvfeelieevjeetvedufeetfeejfeenucfkphepgedurdeiiedrieejrdduudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepgedurdeiiedrieejrdduudefpdhhvghloheplhhotggrlhhhohhsthdpmhgrihhlfhhrohhmpehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgdpnhgspghrtghpthhtohepuddprhgtphhtthhopehffhhmphgvghdquggvvhgvlhesfhhfmhhpvghgrdhorhhg X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH v2 4/6] avutil/tree: Make tree_find_next() non recursive X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org> List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe> List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel> List-Post: <mailto:ffmpeg-devel@ffmpeg.org> List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help> List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>, <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe> Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org> Archived-At: <https://master.gitmailbox.com/ffmpegdev/20250415181433.530161-4-michael@niedermayer.cc/> List-Archive: <https://master.gitmailbox.com/ffmpegdev/> List-Post: <mailto:ffmpegdev@gitmailbox.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavutil/tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavutil/tree.c b/libavutil/tree.c index a4c090e6d04..09c55f6752d 100644 --- a/libavutil/tree.c +++ b/libavutil/tree.c @@ -40,16 +40,16 @@ struct AVTreeNode *av_tree_node_alloc(void) static void tree_find_next(const AVTreeNode *t, const void *key, int (*cmp)(const void *key, const void *b), void *next[4], int nextlen, int direction) { - if (t) { + while (t) { unsigned int v = cmp(key, t->elem); if (v) { next[direction] = t->elem; av_assert2((v >> 31) == direction); - tree_find_next(t->child[!direction], key, cmp, next, nextlen, direction); + t = t->child[!direction]; } else { if (nextlen >= 4) next[2+direction] = t->elem; - tree_find_next(t->child[direction], key, cmp, next, nextlen, direction); + t = t->child[direction]; } } } -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".