[epiphany] Don't use g_list_length() to check for empty lists
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Don't use g_list_length() to check for empty lists
- Date: Sat, 23 Jul 2011 13:59:21 +0000 (UTC)
commit 4ad500dcbb58a5df0585a1b76e7ed715fb6282f7
Author: Claudio Saavedra <csaavedra igalia com>
Date: Sat Jul 23 16:57:56 2011 +0300
Don't use g_list_length() to check for empty lists
An empty list is simply NULL.
src/ephy-session.c | 2 +-
src/ephy-tabs-menu.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index af2ec68..0fea330 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -208,7 +208,7 @@ client_quit_requested_cb (EggSMClient *sm_client,
*/
downloads = ephy_embed_shell_get_downloads (embed_shell);
- if (ephy_shell_get_default () == NULL || g_list_length (downloads) == 0)
+ if (ephy_shell_get_default () == NULL || downloads == NULL)
{
egg_sm_client_will_quit (sm_client, TRUE);
return;
diff --git a/src/ephy-tabs-menu.c b/src/ephy-tabs-menu.c
index 2cb79b6..4e5f8ee 100644
--- a/src/ephy-tabs-menu.c
+++ b/src/ephy-tabs-menu.c
@@ -460,7 +460,7 @@ ephy_tabs_menu_update (EphyTabsMenu *menu)
tabs = ephy_embed_container_get_children (EPHY_EMBED_CONTAINER (p->window));
- if (g_list_length (tabs) == 0) return;
+ if (tabs == NULL) return;
manager = GTK_UI_MANAGER (ephy_window_get_ui_manager (p->window));
p->ui_id = gtk_ui_manager_new_merge_id (manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]