This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed up the 'if/else'


> From: Jiang Jilin <freephp@gmail.com>
> Date: Sun, 30 Aug 2009 09:12:26 +0800
> 
> 2009-08-30  Jiang Jilin <freephp@gmail.com>
> 
> 	* reverse.c (exec_reverse_once): add 'else' to speed up

Sorry, but this is pointless and only makes the code harder to read.

> diff --git a/gdb/reverse.c b/gdb/reverse.c
> index ee59cf3..f2af6d1 100644
> --- a/gdb/reverse.c
> +++ b/gdb/reverse.c
> @@ -48,9 +48,8 @@ exec_reverse_once (char *cmd, char *args, int from_tty)
>    struct cleanup *old_chain;
>  
>    if (dir == EXEC_ERROR)
> -    error (_("Target %s does not support this command."), target_shortname);
> -
> -  if (dir == EXEC_REVERSE)
> +    error (_("Target %s does not support this command."), target_shortname); 
> +  else if (dir == EXEC_REVERSE)
>      error (_("Already in reverse mode.  Use '%s' or 'set exec-dir forward'."),
>  	   cmd);
>  
> -- 
> 1.5.4.3
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]