From 0fa3c5c5610140d0197d797b025d48b5f7e0feb2 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 11 Apr 2023 07:23:48 +0200 Subject: [PATCH] typefindhelper: Avoid dead assignment Move variables within the loop (where they are actually used) Part-of: --- subprojects/gstreamer/libs/gst/base/gsttypefindhelper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subprojects/gstreamer/libs/gst/base/gsttypefindhelper.c b/subprojects/gstreamer/libs/gst/base/gsttypefindhelper.c index dcceac766f..ab7f69176d 100644 --- a/subprojects/gstreamer/libs/gst/base/gsttypefindhelper.c +++ b/subprojects/gstreamer/libs/gst/base/gsttypefindhelper.c @@ -728,10 +728,9 @@ gst_type_find_helper_for_data_with_caps (GstObject * obj, { GstTypeFind *find; GstTypeFindData *find_data; - GstTypeFindFactory *factory; GList *l, *factories = NULL; GstCaps *result = NULL; - GstTypeFindProbability found_probability, last_found_probability; + GstTypeFindProbability last_found_probability; g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (caps != NULL, NULL); @@ -747,11 +746,11 @@ gst_type_find_helper_for_data_with_caps (GstObject * obj, goto out; } - found_probability = GST_TYPE_FIND_NONE; last_found_probability = GST_TYPE_FIND_NONE; for (l = factories; l; l = l->next) { - factory = GST_TYPE_FIND_FACTORY (l->data); + GstTypeFindProbability found_probability; + GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (l->data); gst_type_find_factory_call_function (factory, find);