gststructure: rejig test ordering for speed

https://bugzilla.gnome.org/show_bug.cgi?id=662777
This commit is contained in:
Vincent Penquerc'h 2011-10-27 09:45:41 +01:00
parent e97eeb5cd4
commit 7090257a83

View file

@ -3137,13 +3137,14 @@ gst_caps_structure_is_subset_field (GQuark field_id, const GValue * value,
*
* First caps subtraction needs to return a non-empty set, second
* subtractions needs to give en empty set.
* Both substractions are switched below, as it's faster that way.
*/
if (gst_value_subtract (&subtraction, other, value)) {
g_value_unset (&subtraction);
/* !empty result, swapping must be empty */
if (!gst_value_subtract (&subtraction, value, other))
if (!gst_value_subtract (&subtraction, value, other)) {
if (gst_value_subtract (&subtraction, other, value)) {
g_value_unset (&subtraction);
return TRUE;
}
} else {
g_value_unset (&subtraction);
}
return FALSE;