summaryrefslogtreecommitdiffstats
path: root/src/call-forwarding.c
diff options
context:
space:
mode:
authorOleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>2012-04-10 15:17:22 +0300
committerDenis Kenzior <denkenz@gmail.com>2012-04-23 15:21:17 -0500
commit9b37eefdb71572105f2e8402ac11e6068faeabb9 (patch)
treeec8e0ef7e17960a9830ee24f487bf7a5242308ae /src/call-forwarding.c
parentfe1ced212f8c2c4598a8431ff361e227aded7ab2 (diff)
downloadofono-9b37eefdb71572105f2e8402ac11e6068faeabb9.tar.bz2
call-forwarding: Refactor cf_condition_compare()
Diffstat (limited to 'src/call-forwarding.c')
-rw-r--r--src/call-forwarding.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 8b6659a6..2b912504 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -86,18 +86,12 @@ static void get_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf);
-static gint cf_condition_compare(gconstpointer a, gconstpointer b)
+static gint cf_cond_compare(gconstpointer a, gconstpointer b)
{
const struct ofono_call_forwarding_condition *ca = a;
const struct ofono_call_forwarding_condition *cb = b;
- if (ca->cls < cb->cls)
- return -1;
-
- if (ca->cls > cb->cls)
- return 1;
-
- return 0;
+ return ca->cls - cb->cls;
}
static gint cf_condition_find_with_cls(gconstpointer a, gconstpointer b)
@@ -175,8 +169,7 @@ static GSList *cf_cond_list_create(int total,
sizeof(struct ofono_call_forwarding_condition));
cond->cls = j;
- l = g_slist_insert_sorted(l, cond,
- cf_condition_compare);
+ l = g_slist_insert_sorted(l, cond, cf_cond_compare);
}
}