mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 04:05:34 +00:00
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 <spglegle yahoo fr> * gst/gstvalue.c: (gst_value_is_fixed): Optimisation: bail out of the loop as early as possible (#500143).
This commit is contained in:
parent
5cb869bfdf
commit
c2683ff751
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-12-28 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
Based on patch by: Laurent Glayal <spglegle yahoo fr>
|
||||||
|
|
||||||
|
* 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 <tim at centricular dot net>
|
2007-12-28 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* gst/gstcaps.c: (gst_caps_to_string):
|
* gst/gstcaps.c: (gst_caps_to_string):
|
||||||
|
|
|
@ -3330,7 +3330,6 @@ gst_value_is_fixed (const GValue * value)
|
||||||
GType type = G_VALUE_TYPE (value);
|
GType type = G_VALUE_TYPE (value);
|
||||||
|
|
||||||
if (type == GST_TYPE_ARRAY) {
|
if (type == GST_TYPE_ARRAY) {
|
||||||
gboolean fixed = TRUE;
|
|
||||||
gint size, n;
|
gint size, n;
|
||||||
const GValue *kid;
|
const GValue *kid;
|
||||||
|
|
||||||
|
@ -3338,10 +3337,10 @@ gst_value_is_fixed (const GValue * value)
|
||||||
size = gst_value_array_get_size (value);
|
size = gst_value_array_get_size (value);
|
||||||
for (n = 0; n < size; n++) {
|
for (n = 0; n < size; n++) {
|
||||||
kid = gst_value_array_get_value (value, n);
|
kid = gst_value_array_get_value (value, n);
|
||||||
fixed &= gst_value_is_fixed (kid);
|
if (!gst_value_is_fixed (kid))
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
return TRUE;
|
||||||
return fixed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return gst_type_is_fixed (type);
|
return gst_type_is_fixed (type);
|
||||||
|
|
Loading…
Reference in a new issue