summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-11-16 03:37:56 +0000
committerKarl Heuer <kwzh@gnu.org>1994-11-16 03:37:56 +0000
commita01b8464ff4d250a91dead5012f221373d0deb9a (patch)
treef78afb7a01facc6b371193140b1370f013ae75a3 /src/fns.c
parenta81fe332f57f3b92ded04322182b3706227a6e55 (diff)
downloademacs-a01b8464ff4d250a91dead5012f221373d0deb9a.tar.gz
(Flength): Don't call Farray_length, just use size field.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/fns.c b/src/fns.c
index e05afe1a776..7df032086a8 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -101,29 +101,28 @@ A byte-code function object is also allowed.")
register int i;
retry:
- if (VECTORP (obj) || STRINGP (obj) || COMPILEDP (obj))
- return Farray_length (obj);
+ if (STRINGP (obj))
+ XSETFASTINT (val, XSTRING (obj)->size);
+ else if (VECTORP (obj) || COMPILEDP (obj))
+ XSETFASTINT (val, XVECTOR (obj)->size);
else if (CONSP (obj))
{
- for (i = 0, tail = obj; !NILP(tail); i++)
+ for (i = 0, tail = obj; !NILP (tail); i++)
{
QUIT;
tail = Fcdr (tail);
}
XSETFASTINT (val, i);
- return val;
- }
- else if (NILP(obj))
- {
- XSETFASTINT (val, 0);
- return val;
}
+ else if (NILP (obj))
+ XSETFASTINT (val, 0);
else
{
obj = wrong_type_argument (Qsequencep, obj);
goto retry;
}
+ return val;
}
DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,