unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25338: [PATCH] Remove local variable with only one usage
@ 2017-01-02 21:50 Chris Gregory
  2017-01-07  8:26 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Gregory @ 2017-01-02 21:50 UTC (permalink / raw)
  To: 25338


-- 
Chris Gregory

diff --git a/src/term.c b/src/term.c
index c067a86d18..0e8ad60de4 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3426,10 +3426,7 @@ tty_menu_last_menubar_item (struct frame *f)
 
       while (i < ASIZE (items))
 	{
-	  Lisp_Object str;
-
-	  str = AREF (items, i + 1);
-	  if (NILP (str))
+	  if (NILP (AREF (items, i + 1)))
 	    break;
 	  i += 4;
 	}





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#25338: [PATCH] Remove local variable with only one usage
  2017-01-02 21:50 bug#25338: [PATCH] Remove local variable with only one usage Chris Gregory
@ 2017-01-07  8:26 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2017-01-07  8:26 UTC (permalink / raw)
  To: Chris Gregory; +Cc: 25338

tags 25338 notabug
close 25338
thanks

> From: Chris Gregory <czipperz@gmail.com>
> Date: Mon, 02 Jan 2017 13:50:01 -0800

Thanks.

IMO, we are splitting hair here.  In an optimized build, a compiler
will optimize 'str' and keep the value in a register, so the variable
doesn't matter.  In a non-optimized build, the existence of the
variable allows to look at it in a debugger.  And the loop is small
enough so that an extra variable local to the loop doesn't make it
more complicated.

So I'd rather not make this change.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-07  8:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-02 21:50 bug#25338: [PATCH] Remove local variable with only one usage Chris Gregory
2017-01-07  8:26 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).