diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-06-30 19:57:49 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-06-30 19:57:49 (GMT) |
commit | 5431e3085329bd6e78b1b72d74e8445f420a5f74 (patch) | |
tree | 3743729dd365ea3e396bc95e42e664a128c42627 /Modules/_decimal | |
parent | 1abe1c5fe13ca64c54e16db25de7c4dd5578a7c1 (diff) | |
download | cpython-5431e3085329bd6e78b1b72d74e8445f420a5f74.zip cpython-5431e3085329bd6e78b1b72d74e8445f420a5f74.tar.gz cpython-5431e3085329bd6e78b1b72d74e8445f420a5f74.tar.bz2 |
After 79d2eb29c755 it is no longer necessary to zero the output array:
None of the _mpd_shortadd() or _mpd_shortmul() functions read uninitialized
values. Previously zeroing was required since _mpd_real_size() was called
on the output array.
Diffstat (limited to 'Modules/_decimal')
-rw-r--r-- | Modules/_decimal/libmpdec/mpdecimal.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index b5f7808..b234400 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -7707,7 +7707,7 @@ _baseconv_to_smaller(uint32_t **w, size_t wlen, uint32_t wbase, wlen = n+1; } (*w)[n++] = (uint32_t)_mpd_shortdiv_b(u, u, ulen, wbase, ubase); - /* ulen will be at least 1. u[ulen-1] can only be zero if ulen == 1 */ + /* ulen is at least 1. u[ulen-1] can only be zero if ulen == 1. */ ulen = _mpd_real_size(u, ulen); } while (u[ulen-1] != 0); @@ -8041,7 +8041,7 @@ mpd_qimport_u16(mpd_t *result, usrc[n] = srcdata[n]; } - if (!mpd_qresize_zero(result, rlen, status)) { + if (!mpd_qresize(result, rlen, status)) { goto finish; } @@ -8084,7 +8084,7 @@ mpd_qimport_u32(mpd_t *result, return; } - if (!mpd_qresize_zero(result, rlen, status)) { + if (!mpd_qresize(result, rlen, status)) { return; } @@ -8094,7 +8094,7 @@ mpd_qimport_u32(mpd_t *result, status); #else if (srcbase == MPD_RADIX) { - if (!mpd_qresize_zero(result, srclen, status)) { + if (!mpd_qresize(result, srclen, status)) { return; } memcpy(result->data, srcdata, srclen * (sizeof *srcdata)); |