From b750de3ec6d0755adff676e7a9baf817500043e6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 11 Oct 2010 20:40:16 -0500 Subject: [PATCH] sim: Don't re-check for id != 0 We already check the id is valid in the get_icon function, there's no reason to re-check it. --- src/sim.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/sim.c b/src/sim.c index a671a8da..300fc4c3 100644 --- a/src/sim.c +++ b/src/sim.c @@ -826,14 +826,6 @@ static void sim_get_image(struct ofono_sim *sim, unsigned char id, unsigned char *efimg; char *image; - /* icon ids should start at 1, our array starts at zero */ - if (id == 0) { - sim_get_image_cb(0, NULL, 0, user_data); - return; - } - - id--; - image = sim_fs_get_cached_image(sim->simfs, id); if (image == NULL) @@ -901,7 +893,7 @@ static DBusMessage *sim_get_icon(DBusConnection *conn, sim->pending = dbus_message_ref(msg); - sim_get_image(sim, id, sim); + sim_get_image(sim, id - 1, sim); return NULL; }