core: short-circuit nm_device_spec_match_list()

If there are no specs, then the device can't match, so don't call the
virtual method (which might do work like building comparison strings
even when the list is empty).
This commit is contained in:
Dan Winship 2013-09-23 09:44:32 -04:00
parent d20ac49dc9
commit b91d029021

View file

@ -6347,6 +6347,9 @@ nm_device_spec_match_list (NMDevice *device, const GSList *specs)
{
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
if (!specs)
return FALSE;
return NM_DEVICE_GET_CLASS (device)->spec_match_list (device, specs);
}