diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c index 031c78c07ca..92945bc8afc 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3321,14 +3321,9 @@ See also the function `vector'. */) | |||
| 3321 | (Lisp_Object length, Lisp_Object init) | 3321 | (Lisp_Object length, Lisp_Object init) |
| 3322 | { | 3322 | { |
| 3323 | CHECK_NATNUM (length); | 3323 | CHECK_NATNUM (length); |
| 3324 | |||
| 3325 | struct Lisp_Vector *p = allocate_vector (XFASTINT (length)); | 3324 | struct Lisp_Vector *p = allocate_vector (XFASTINT (length)); |
| 3326 | if (XLI (init) == 0) | 3325 | for (ptrdiff_t i = 0; i < XFASTINT (length); i++) |
| 3327 | memset (p->contents, 0, XFASTINT (length) * sizeof p->contents[0]); | 3326 | p->contents[i] = init; |
| 3328 | else | ||
| 3329 | for (ptrdiff_t i = 0; i < XFASTINT (length); i++) | ||
| 3330 | p->contents[i] = init; | ||
| 3331 | |||
| 3332 | return make_lisp_ptr (p, Lisp_Vectorlike); | 3327 | return make_lisp_ptr (p, Lisp_Vectorlike); |
| 3333 | } | 3328 | } |
| 3334 | 3329 | ||