]> diplodocus.org Git - nmh/commit
sbr/vector.c: Zero the growth with memset(3), not loop.
authorRalph Corderoy <ralph@inputplus.co.uk>
Wed, 26 Apr 2017 23:14:28 +0000 (00:14 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Wed, 26 Apr 2017 23:14:28 +0000 (00:14 +0100)
commitc8caafcb4a39516eaec330f9ea229ea52e5fe46b
tree3642accbf3089d3875479d281806dba475fbdbfe
parentf77e0b578f71edb6f9105d5af8d54c8237cd9078
sbr/vector.c: Zero the growth with memset(3), not loop.

When the resize functions grow the vectors, as they always do, zero the
new slots with memset(3) rather than a for loop.  Particularly of note
for the bit vector where it was bvector_clear()ing one bit at a time.
Although a NULL pointer needn't have a representation of all-zero bits,
the code was already assuming that, e.g. on the initial allocation, so
we're no worse off.
sbr/vector.c