Mercurial > emacs
changeset 9965:f68eab303ddb
(Flength): Don't call Farray_length, just use size field.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 16 Nov 1994 03:37:56 +0000 |
parents | 9e6b15b701e4 |
children | d64bdd958254 |
files | src/fns.c |
diffstat | 1 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fns.c Wed Nov 16 03:11:59 1994 +0000 +++ b/src/fns.c Wed Nov 16 03:37:56 1994 +0000 @@ -101,29 +101,28 @@ 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,