[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master efdcd7b8f78 3/8: Remove BASE2_EQ
From: |
Paul Eggert |
Subject: |
master efdcd7b8f78 3/8: Remove BASE2_EQ |
Date: |
Tue, 13 Feb 2024 14:20:42 -0500 (EST) |
branch: master
commit efdcd7b8f78ef22c0213ea770a552fb69b789381
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
Remove BASE2_EQ
* src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): Remove. All uses
removed. BASE2_EQ was present only for minor optimization and
with current gcc -O2, BASE2_EQ does not affect performance, so
it’s not worth the hassle.
---
src/lisp.h | 18 +++---------------
src/lread.c | 4 +++-
src/timefns.c | 6 +++---
3 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/src/lisp.h b/src/lisp.h
index b609bef990c..0b676a027eb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -384,14 +384,11 @@ typedef EMACS_INT Lisp_Word;
((ok) ? (void) 0 : wrong_type_argument (predicate, x))
#define lisp_h_CONSP(x) TAGGEDP (x, Lisp_Cons)
#define lisp_h_BASE_EQ(x, y) (XLI (x) == XLI (y))
-#define lisp_h_BASE2_EQ(x, y) \
+#define lisp_h_EQ(x, y) \
BASE_EQ ((symbols_with_pos_enabled && SYMBOL_WITH_POS_P (x) \
? XSYMBOL_WITH_POS (x)->sym : (x)), \
- y)
-#define lisp_h_EQ(x, y) \
- BASE2_EQ (x, \
- (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) \
- ? XSYMBOL_WITH_POS (y)->sym : (y)))
+ (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) \
+ ? XSYMBOL_WITH_POS (y)->sym : (y)))
#define lisp_h_FIXNUMP(x) \
(! (((unsigned) (XLI (x) >> (USE_LSB_TAG ? 0 : FIXNUM_BITS)) \
@@ -461,7 +458,6 @@ typedef EMACS_INT Lisp_Word;
# define CHECK_TYPE(ok, predicate, x) lisp_h_CHECK_TYPE (ok, predicate, x)
# define CONSP(x) lisp_h_CONSP (x)
# define BASE_EQ(x, y) lisp_h_BASE_EQ (x, y)
-# define BASE2_EQ(x, y) lisp_h_BASE2_EQ (x, y)
# define FLOATP(x) lisp_h_FLOATP (x)
# define FIXNUMP(x) lisp_h_FIXNUMP (x)
# define NILP(x) lisp_h_NILP (x)
@@ -1339,14 +1335,6 @@ INLINE bool
return lisp_h_BASE_EQ (x, y);
}
-/* Return true if X and Y are the same object, reckoning X to be the
- same as a bare symbol Y if X is Y with position. */
-INLINE bool
-(BASE2_EQ) (Lisp_Object x, Lisp_Object y)
-{
- return lisp_h_BASE2_EQ (x, y);
-}
-
/* Return true if X and Y are the same object, reckoning a symbol with
position as being the same as the bare symbol. */
INLINE bool
diff --git a/src/lread.c b/src/lread.c
index d339b2f15ae..551bfd735a2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -5063,10 +5063,12 @@ it defaults to the value of `obarray'. */)
{
/* If already a symbol, we don't do shorthand-longhand translation,
as promised in the docstring. */
+ Lisp_Object sym = (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (name)
+ ? XSYMBOL_WITH_POS (name)->sym : name);
string = XSYMBOL (name)->u.s.name;
tem
= oblookup (obarray, SSDATA (string), SCHARS (string), SBYTES (string));
- return BASE2_EQ (name, tem) ? name : Qnil;
+ return BASE_EQ (sym, tem) ? name : Qnil;
}
}
diff --git a/src/timefns.c b/src/timefns.c
index 1541583b485..fc1edf136cb 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -225,7 +225,7 @@ tzlookup (Lisp_Object zone, bool settz)
if (NILP (zone))
return local_tz;
- else if (BASE_EQ (zone, make_fixnum (0)) || BASE2_EQ (zone, Qt))
+ else if (BASE_EQ (zone, make_fixnum (0)) || EQ (zone, Qt))
{
zone_string = "UTC0";
new_tz = utc_tz;
@@ -234,7 +234,7 @@ tzlookup (Lisp_Object zone, bool settz)
{
bool plain_integer = FIXNUMP (zone);
- if (BASE2_EQ (zone, Qwall))
+ if (EQ (zone, Qwall))
zone_string = 0;
else if (STRINGP (zone))
zone_string = SSDATA (ENCODE_SYSTEM (zone));
@@ -1548,7 +1548,7 @@ usage: (decode-time &optional TIME ZONE FORM) */)
/* Compute SEC from LOCAL_TM.tm_sec and HZ. */
Lisp_Object hz = lt.hz, sec;
- if (BASE_EQ (hz, make_fixnum (1)) || !BASE2_EQ (form, Qt))
+ if (BASE_EQ (hz, make_fixnum (1)) || !EQ (form, Qt))
sec = make_fixnum (local_tm.tm_sec);
else
{
- master updated (d61145cc8cf -> a4a99405d00), Paul Eggert, 2024/02/13
- master 08c18632574 2/8: Simplify and speed up EQ again, Paul Eggert, 2024/02/13
- master d202f1b9e74 7/8: XSYMBOL eassume speedups, Paul Eggert, 2024/02/13
- master efdcd7b8f78 3/8: Remove BASE2_EQ,
Paul Eggert <=
- master a4a99405d00 8/8: Simplify position-symbol, Paul Eggert, 2024/02/13
- master 231af322b07 4/8: Remove lisp_h_PSEUDOVECTORP etc, Paul Eggert, 2024/02/13
- master 473dac88010 5/8: Remove lisp_h_XCONS etc, Paul Eggert, 2024/02/13
- master d2a5d7534c7 1/8: Simplify and speed up EQ, Paul Eggert, 2024/02/13
- master 10c6aea4434 6/8: Remove SYMBOL_WITH_POS_{POS,SYM}, Paul Eggert, 2024/02/13