summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2009-07-30 10:05:10 +0200
committerDenis Kenzior <denkenz@gmail.com>2009-07-31 09:56:21 -0500
commitcfce4413c6a17e5094ae6c991255c8e93a4487cf (patch)
treedd86ba2ccad06c9f9f73f76b0ac694b3f5735511
parentebf6fca07a760eb85e8f339542706425dbd8de48 (diff)
downloadofono-cfce4413c6a17e5094ae6c991255c8e93a4487cf.tar.bz2
Don't use g_slist_length to check for empty lists.
A glib Anti-pattern according to http://www.burtonini.com/blog
-rw-r--r--src/voicecall.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index a06797df..bfe3fbcb 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -895,7 +895,7 @@ static DBusMessage *manager_hangup_all(DBusConnection *conn,
if (!calls->ops->release_specific)
return __ofono_error_not_implemented(msg);
- if (g_slist_length(calls->call_list) == 0) {
+ if (calls->call_list == NULL) {
DBusMessage *reply = dbus_message_new_method_return(msg);
return reply;
}
@@ -1007,7 +1007,7 @@ static DBusMessage *multiparty_hangup(DBusConnection *conn,
if (!calls->ops->release_all_active)
return __ofono_error_not_implemented(msg);
- if (g_slist_length(calls->multiparty_list) == 0) {
+ if (calls->multiparty_list == NULL) {
DBusMessage *reply = dbus_message_new_method_return(msg);
return reply;
}
@@ -1360,7 +1360,7 @@ static void multirelease_callback(const struct ofono_error *error, void *data)
DBusConnection *conn = ofono_dbus_get_connection();
DBusMessage *reply;
- if (g_slist_length(calls->release_list)) {
+ if (calls->release_list != NULL) {
voicecalls_release_next(modem);
return;
}