[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] monitor: Remove uneeded goto
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 3/4] monitor: Remove uneeded goto |
Date: |
Tue, 9 Jun 2009 18:21:54 -0300 |
The 'found' goto in monitor_handle_command() can be dropped if we check
for 'cmd->name' after looking up for the command to execute.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/monitor.c b/monitor.c
index 9b11341..0ef3bce 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2446,11 +2446,13 @@ static void monitor_handle_command(Monitor *mon, const
char *cmdline)
/* find the command */
for(cmd = mon_cmds; cmd->name != NULL; cmd++) {
if (compare_cmd(cmdname, cmd->name))
- goto found;
+ break;
+ }
+
+ if (cmd->name == NULL) {
+ monitor_printf(mon, "unknown command: '%s'\n", cmdname);
+ return;
}
- monitor_printf(mon, "unknown command: '%s'\n", cmdname);
- return;
- found:
for(i = 0; i < MAX_ARGS; i++)
str_allocated[i] = NULL;
--
1.6.3.GIT
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH 3/4] monitor: Remove uneeded goto,
Luiz Capitulino <=