summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-06-15 23:08:03 -0500
committerPaul Eggert <eggert@cs.ucla.edu>2022-06-15 23:27:08 -0500
commit343482d641511b54aa0444791770b4ea70d27cc7 (patch)
treef3afc7ffb3366bedaed07b66c5e1b13eb851cd29 /src/lisp.h
parent9a2be29672b8569406777af24d60f0afabf8b52d (diff)
downloademacs-343482d641511b54aa0444791770b4ea70d27cc7.tar.gz
Streamline time decoding and conversion
* src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): New macros and functions. * src/timefns.c (tzlookup, Fdecode_time): Use them. (Ftime_convert): Convert to symbol once, instead of many times.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 499bacc3303..05b0754ff65 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -368,6 +368,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) \
+ (BASE_EQ (x, y) \
+ || (symbols_with_pos_enabled \
+ && SYMBOL_WITH_POS_P (x) \
+ && BASE_EQ (XSYMBOL_WITH_POS (x)->sym, y)))
/* FIXME: Do we really need to inline the whole thing?
* What about keeping the part after `symbols_with_pos_enabled` in
@@ -453,6 +458,7 @@ 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)
@@ -1318,6 +1324,14 @@ 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