mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-02 23:50:47 +02:00
Simplify vector constructor
* libguile/vectors.c: Remove redundant list check.
This commit is contained in:
parent
5a2f73faf5
commit
82d8f025b1
1 changed files with 5 additions and 9 deletions
|
@ -122,20 +122,16 @@ SCM_DEFINE (scm_vector, "vector", 0, 0, 1,
|
|||
"@end lisp")
|
||||
#define FUNC_NAME s_scm_vector
|
||||
{
|
||||
SCM res;
|
||||
SCM *data;
|
||||
long i, len;
|
||||
|
||||
long len;
|
||||
SCM_VALIDATE_LIST_COPYLEN (1, l, len);
|
||||
|
||||
SCM res = scm_c_make_vector (len, SCM_UNSPECIFIED);
|
||||
SCM *data = SCM_I_VECTOR_WELTS (res);
|
||||
|
||||
res = scm_c_make_vector (len, SCM_UNSPECIFIED);
|
||||
data = SCM_I_VECTOR_WELTS (res);
|
||||
i = 0;
|
||||
while (scm_is_pair (l) && i < len)
|
||||
for (long i=0; i < len; ++i)
|
||||
{
|
||||
data[i] = SCM_CAR (l);
|
||||
l = SCM_CDR (l);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue