core: optimize nm_match_spec_s390_subchannels() to return early

No need to parse the subchannels if the spec list is empty.

This isn't actually an issue, because nm_match_spec_s390_subchannels()
was never called with empty spec list.
This commit is contained in:
Thomas Haller 2015-04-17 14:09:55 +02:00
parent 6b0f84bdda
commit de9848aa66

View file

@ -1108,6 +1108,9 @@ nm_match_spec_s390_subchannels (const GSList *specs, const char *subchannels)
g_return_val_if_fail (subchannels != NULL, NM_MATCH_SPEC_NO_MATCH);
if (!specs)
return NM_MATCH_SPEC_NO_MATCH;
if (!parse_subchannels (subchannels, &a, &b, &c))
return NM_MATCH_SPEC_NO_MATCH;