summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2006-07-13 13:43:38 +0000
committerKim F. Storm <storm@cua.dk>2006-07-13 13:43:38 +0000
commit14c5155a18934ab22c052886978661abe0a259df (patch)
tree9cdc859f728945ac9ae0da7522e37ce6c9b38cd4 /src/bytecode.c
parentf3500bbee134676ddc9716ee2485174c8e9bef06 (diff)
downloademacs-14c5155a18934ab22c052886978661abe0a259df.tar.gz
(Fbyte_code): Use CAR, CDR for Bcar, Bcdr.
Use CAR_SAFE, CDR_SAFE for Bcar_safe, Bcdr_safe. Simplify loops and use CAR for Bnth and Belt.
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c62
1 files changed, 10 insertions, 52 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index d71006cb660..2facaa47062 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -541,12 +541,7 @@ If the third argument is incorrect, Emacs may crash. */)
{
Lisp_Object v1;
v1 = TOP;
- if (CONSP (v1))
- TOP = XCAR (v1);
- else if (NILP (v1))
- TOP = Qnil;
- else
- wrong_type_argument (Qlistp, v1);
+ TOP = CAR (v1);
break;
}
@@ -572,12 +567,7 @@ If the third argument is incorrect, Emacs may crash. */)
{
Lisp_Object v1;
v1 = TOP;
- if (CONSP (v1))
- TOP = XCDR (v1);
- else if (NILP (v1))
- TOP = Qnil;
- else
- wrong_type_argument (Qlistp, v1);
+ TOP = CDR (v1);
break;
}
@@ -912,23 +902,10 @@ If the third argument is incorrect, Emacs may crash. */)
AFTER_POTENTIAL_GC ();
op = XINT (v2);
immediate_quit = 1;
- while (--op >= 0)
- {
- if (CONSP (v1))
- v1 = XCDR (v1);
- else if (!NILP (v1))
- {
- immediate_quit = 0;
- wrong_type_argument (Qlistp, v1);
- }
- }
+ while (--op >= 0 && CONSP (v1))
+ v1 = XCDR (v1);
immediate_quit = 0;
- if (CONSP (v1))
- TOP = XCAR (v1);
- else if (NILP (v1))
- TOP = Qnil;
- else
- wrong_type_argument (Qlistp, v1);
+ TOP = CAR (v1);
break;
}
@@ -1551,23 +1528,10 @@ If the third argument is incorrect, Emacs may crash. */)
AFTER_POTENTIAL_GC ();
op = XINT (v2);
immediate_quit = 1;
- while (--op >= 0)
- {
- if (CONSP (v1))
- v1 = XCDR (v1);
- else if (!NILP (v1))
- {
- immediate_quit = 0;
- wrong_type_argument (Qlistp, v1);
- }
- }
+ while (--op >= 0 && CONSP (v1))
+ v1 = XCDR (v1);
immediate_quit = 0;
- if (CONSP (v1))
- TOP = XCAR (v1);
- else if (NILP (v1))
- TOP = Qnil;
- else
- wrong_type_argument (Qlistp, v1);
+ TOP = CAR (v1);
}
else
{
@@ -1629,10 +1593,7 @@ If the third argument is incorrect, Emacs may crash. */)
{
Lisp_Object v1;
v1 = TOP;
- if (CONSP (v1))
- TOP = XCAR (v1);
- else
- TOP = Qnil;
+ TOP = CAR_SAFE (v1);
break;
}
@@ -1640,10 +1601,7 @@ If the third argument is incorrect, Emacs may crash. */)
{
Lisp_Object v1;
v1 = TOP;
- if (CONSP (v1))
- TOP = XCDR (v1);
- else
- TOP = Qnil;
+ TOP = CDR_SAFE (v1);
break;
}