aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-11-16 03:37:56 +0000
committerKarl Heuer1994-11-16 03:37:56 +0000
commita2ad3e19d3aea7628b69630acea5badedf0f12f1 (patch)
tree9003e7a3d77549097d92204183604b32afb647e7 /src
parentcec4abce27a2de7ce5825838b313f12b9c48a996 (diff)
downloademacs-a2ad3e19d3aea7628b69630acea5badedf0f12f1.tar.gz
emacs-a2ad3e19d3aea7628b69630acea5badedf0f12f1.zip
(Flength): Don't call Farray_length, just use size field.
Diffstat (limited to 'src')
-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.")
101 register int i; 101 register int i;
102 102
103 retry: 103 retry:
104 if (VECTORP (obj) || STRINGP (obj) || COMPILEDP (obj)) 104 if (STRINGP (obj))
105 return Farray_length (obj); 105 XSETFASTINT (val, XSTRING (obj)->size);
106 else if (VECTORP (obj) || COMPILEDP (obj))
107 XSETFASTINT (val, XVECTOR (obj)->size);
106 else if (CONSP (obj)) 108 else if (CONSP (obj))
107 { 109 {
108 for (i = 0, tail = obj; !NILP(tail); i++) 110 for (i = 0, tail = obj; !NILP (tail); i++)
109 { 111 {
110 QUIT; 112 QUIT;
111 tail = Fcdr (tail); 113 tail = Fcdr (tail);
112 } 114 }
113 115
114 XSETFASTINT (val, i); 116 XSETFASTINT (val, i);
115 return val;
116 }
117 else if (NILP(obj))
118 {
119 XSETFASTINT (val, 0);
120 return val;
121 } 117 }
118 else if (NILP (obj))
119 XSETFASTINT (val, 0);
122 else 120 else
123 { 121 {
124 obj = wrong_type_argument (Qsequencep, obj); 122 obj = wrong_type_argument (Qsequencep, obj);
125 goto retry; 123 goto retry;
126 } 124 }
125 return val;
127} 126}
128 127
129DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, 128DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,