]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify position-symbol
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 13 Feb 2024 17:54:51 +0000 (09:54 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 14 Feb 2024 08:16:25 +0000 (09:16 +0100)
* src/data.c (Fposition_symbol): Simplify by calling Fbare_symbol
rather than open-coding it.

(cherry picked from commit a4a99405d00b98aeb86040117402ed0e1f954833)

src/data.c

index 530bb774171f88cb7c7ac47745ca9f05b29e40a7..f2f35fb355aa188db6865a84f10a2a8122a6a7f6 100644 (file)
@@ -821,16 +821,9 @@ POS, the position, is either a fixnum or a symbol with position from which
 the position will be taken.  */)
      (register Lisp_Object sym, register Lisp_Object pos)
 {
-  Lisp_Object bare;
+  Lisp_Object bare = Fbare_symbol (sym);
   Lisp_Object position;
 
-  if (BARE_SYMBOL_P (sym))
-    bare = sym;
-  else if (SYMBOL_WITH_POS_P (sym))
-    bare = XSYMBOL_WITH_POS_SYM (sym);
-  else
-    wrong_type_argument (Qsymbolp, sym);
-
   if (FIXNUMP (pos))
     position = pos;
   else if (SYMBOL_WITH_POS_P (pos))