diff options
author | Dan Winship <danw@gnome.org> | 2014-08-25 10:33:53 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-09-04 09:21:05 -0400 |
commit | 3e5b3833aa4964f6d2224560f3ad8c7ffa1e8027 (patch) | |
tree | 411d50040fa8997bcd912e1f4eebd83c364a0e4a /libnm/nm-device-team.c | |
parent | 074c2093b6a733c3d5712a7c58386e1e652a8903 (diff) | |
download | NetworkManager-3e5b3833aa4964f6d2224560f3ad8c7ffa1e8027.tar.gz |
libnm: change empty-GPtrArray-return semantics
libnm functions that return GPtrArrays of objects had a rule that if
the array was empty, they would return NULL rather than a 0-length
array. As it turns out, this is just a nuisance to clients, since in
most places the code for the non-empty case would end up doing the
right thing for the empty case as well (and where it doesn't, we can
check "array->len == 0" just as easily as "array == NULL"). So just
return the 0-length array instead.
Diffstat (limited to 'libnm/nm-device-team.c')
-rw-r--r-- | libnm/nm-device-team.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index 0aeda17039..27deda8a5a 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -118,7 +118,7 @@ nm_device_team_get_slaves (NMDeviceTeam *device) { g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), FALSE); - return handle_ptr_array_return (NM_DEVICE_TEAM_GET_PRIVATE (device)->slaves); + return NM_DEVICE_TEAM_GET_PRIVATE (device)->slaves; } static const char * |