From c2683ff7515cae3ee4b7b715e6d0558887678c31 Mon Sep 17 00:00:00 2001 From: Laurent Glayal Date: Fri, 28 Dec 2007 14:34:34 +0000 Subject: [PATCH] gst/gstvalue.c: Optimisation: bail out of the loop as early as possible (#500143). Original commit message from CVS: Based on patch by: Laurent Glayal * gst/gstvalue.c: (gst_value_is_fixed): Optimisation: bail out of the loop as early as possible (#500143). --- ChangeLog | 7 +++++++ gst/gstvalue.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4fe4a9c2e..90cd780347 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-28 Tim-Philipp Müller + + Based on patch by: Laurent Glayal + + * gst/gstvalue.c: (gst_value_is_fixed): + Optimisation: bail out of the loop as early as possible (#500143). + 2007-12-28 Tim-Philipp Müller * gst/gstcaps.c: (gst_caps_to_string): diff --git a/gst/gstvalue.c b/gst/gstvalue.c index 1314c828a8..3a694cac29 100644 --- a/gst/gstvalue.c +++ b/gst/gstvalue.c @@ -3330,7 +3330,6 @@ gst_value_is_fixed (const GValue * value) GType type = G_VALUE_TYPE (value); if (type == GST_TYPE_ARRAY) { - gboolean fixed = TRUE; gint size, n; const GValue *kid; @@ -3338,10 +3337,10 @@ gst_value_is_fixed (const GValue * value) size = gst_value_array_get_size (value); for (n = 0; n < size; n++) { kid = gst_value_array_get_value (value, n); - fixed &= gst_value_is_fixed (kid); + if (!gst_value_is_fixed (kid)) + return FALSE; } - - return fixed; + return TRUE; } return gst_type_is_fixed (type);