binding: Simplify the default transform func

https://bugzilla.gnome.org/show_bug.cgi?id=750369
This commit is contained in:
Garrett Regier 2015-06-03 17:16:21 -07:00
parent ace7f6861e
commit bdc3f149ec

View File

@ -256,14 +256,14 @@ default_transform (GBinding *binding,
G_VALUE_TYPE (value_b)))
{
g_value_copy (value_a, value_b);
goto done;
return TRUE;
}
if (g_value_type_transformable (G_VALUE_TYPE (value_a),
G_VALUE_TYPE (value_b)))
{
if (g_value_transform (value_a, value_b))
goto done;
return TRUE;
}
g_warning ("%s: Unable to convert a value of type %s to a "
@ -274,10 +274,8 @@ default_transform (GBinding *binding,
return FALSE;
}
else
g_value_copy (value_a, value_b);
done:
g_value_copy (value_a, value_b);
return TRUE;
}