all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chris Gregory <czipperz@gmail.com>
To: emacs-devel@gnu.org
Subject: Remove unused local variables
Date: Mon, 26 Dec 2016 22:43:59 -0600	[thread overview]
Message-ID: <87pokekmls.fsf@gmail.com> (raw)

This patch removes some local variables that were assigned and then only
used once immediately after.  It also removes a redundant XCDR call in
Fsetq_default.

diff --git a/src/data.c b/src/data.c
index e2c1a28..af25c75 100644
--- a/src/data.c
+++ b/src/data.c
@@ -1720,16 +1720,16 @@ of previous VARs.
 usage: (setq-default [VAR VALUE]...)  */)
   (Lisp_Object args)
 {
-  Lisp_Object args_left, symbol, val;
+  Lisp_Object args_left, val;

   args_left = val = args;

   while (CONSP (args_left))
     {
-      val = eval_sub (Fcar (XCDR (args_left)));
-      symbol = XCAR (args_left);
-      Fset_default (symbol, val);
-      args_left = Fcdr (XCDR (args_left));
+      Lisp_Object cdr_args_left = XCDR (args_left);
+      val = eval_sub (Fcar (cdr_args_left));
+      Fset_default (XCAR (args_left), val);
+      args_left = Fcdr (cdr_args_left);
     }

   return val;
diff --git a/src/lread.c b/src/lread.c
index f14c68e..b2bbf75 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -963,7 +963,7 @@ required.
 This uses the variables `load-suffixes' and `load-file-rep-suffixes'.  */)
   (void)
 {
-  Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix, ext;
+  Lisp_Object lst = Qnil, suffixes = Vload_suffixes, suffix;
   while (CONSP (suffixes))
     {
       Lisp_Object exts = Vload_file_rep_suffixes;
@@ -971,9 +971,8 @@ This uses the variables `load-suffixes' and `load-file-rep-suffixes'.  */)
       suffixes = XCDR (suffixes);
       while (CONSP (exts))
        {
-         ext = XCAR (exts);
+         lst = Fcons (concat2 (suffix, XCAR (exts)), lst);
          exts = XCDR (exts);
-         lst = Fcons (concat2 (suffix, ext), lst);
        }
     }
   return Fnreverse (lst);



                 reply	other threads:[~2016-12-27  4:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pokekmls.fsf@gmail.com \
    --to=czipperz@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.