From 73ca5dcb24c131d3e3a99a89dcd6f1329c9d90f4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 21 Dec 2011 15:15:28 +0100 Subject: cli: don't recheck group options if already done --- cli/mmcli-modem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cli/mmcli-modem.c') diff --git a/cli/mmcli-modem.c b/cli/mmcli-modem.c index 8974f10f..2b4dfbc5 100644 --- a/cli/mmcli-modem.c +++ b/cli/mmcli-modem.c @@ -108,7 +108,11 @@ mmcli_modem_get_option_group (void) gboolean mmcli_modem_options_enabled (void) { - guint n_actions; + static guint n_actions = 0; + static gboolean checked = FALSE; + + if (checked) + return !!n_actions; n_actions = (monitor_state_flag + enable_flag + @@ -136,6 +140,7 @@ mmcli_modem_options_enabled (void) if (info_flag) mmcli_force_sync_operation (); + checked = TRUE; return !!n_actions; } -- cgit v1.2.3-70-g09d2