diff options
| author | Paul Eggert | 2011-06-18 08:39:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-06-18 08:39:24 -0700 |
| commit | c0c1ee9f77d41298cd3b576fdf8b97e5d8d87e17 (patch) | |
| tree | 36eb43aa1802e62b112ddd41461dbd0a0dbf076b /src/alloc.c | |
| parent | a498d7f4f8ce688079d32cac4858ba78d2a9081e (diff) | |
| download | emacs-c0c1ee9f77d41298cd3b576fdf8b97e5d8d87e17.tar.gz emacs-c0c1ee9f77d41298cd3b576fdf8b97e5d8d87e17.zip | |
* alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c index 00d330c1b6a..69623d103c3 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2257,12 +2257,14 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) | |||
| 2257 | p = XBOOL_VECTOR (val); | 2257 | p = XBOOL_VECTOR (val); |
| 2258 | p->size = XFASTINT (length); | 2258 | p->size = XFASTINT (length); |
| 2259 | 2259 | ||
| 2260 | memset (p->data, NILP (init) ? 0 : -1, length_in_chars); | 2260 | if (length_in_chars) |
| 2261 | { | ||
| 2262 | memset (p->data, ! NILP (init) ? -1 : 0, length_in_chars); | ||
| 2261 | 2263 | ||
| 2262 | /* Clear the extraneous bits in the last byte. */ | 2264 | /* Clear any extraneous bits in the last byte. */ |
| 2263 | if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) | 2265 | p->data[length_in_chars - 1] |
| 2264 | p->data[length_in_chars - 1] | 2266 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; |
| 2265 | &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; | 2267 | } |
| 2266 | 2268 | ||
| 2267 | return val; | 2269 | return val; |
| 2268 | } | 2270 | } |