diff options
author | ckennelly <ckennelly@google.com> | 2016-05-26 14:51:33 -0700 |
---|---|---|
committer | Alkis Evlogimenos <alkis@google.com> | 2017-01-26 21:35:55 +0100 |
commit | e788e527d3d16db4059f92291c7806fe273c8f67 (patch) | |
tree | 7a1f099fbdba40394c1fc862bb3fa2df53fb1bb4 /snappy.cc | |
parent | 32d6d7d8a2ef328a2ee1dd40f072e21f4983ebda (diff) | |
download | snappy-e788e527d3d16db4059f92291c7806fe273c8f67.tar.gz snappy-e788e527d3d16db4059f92291c7806fe273c8f67.tar.bz2 snappy-e788e527d3d16db4059f92291c7806fe273c8f67.zip |
Avoid calling memset when resizing the buffer.
This buffer will be initialized and then trimmed down to size during the
compression phase.
Diffstat (limited to 'snappy.cc')
-rw-r--r-- | snappy.cc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1151,7 +1151,7 @@ void RawCompress(const char* input, size_t Compress(const char* input, size_t input_length, string* compressed) { // Pre-grow the buffer to the max length of the compressed output - compressed->resize(MaxCompressedLength(input_length)); + STLStringResizeUninitialized(compressed, MaxCompressedLength(input_length)); size_t compressed_length; RawCompress(input, input_length, string_as_array(compressed), |