adamdebreceni commented on a change in pull request #979: URL: https://github.com/apache/nifi-minifi-cpp/pull/979#discussion_r585570186
########## File path: extensions/aws/s3/S3WrapperBase.cpp ########## @@ -142,13 +142,11 @@ bool S3WrapperBase::deleteObject(const std::string& bucket, const std::string& o } int64_t S3WrapperBase::writeFetchedBody(Aws::IOStream& source, const int64_t data_size, const std::shared_ptr<io::BaseStream>& output) { - static const uint64_t BUFFER_SIZE = 4096; - std::vector<uint8_t> buffer; - buffer.reserve(BUFFER_SIZE); + std::vector<uint8_t> buffer(4096); int64_t write_size = 0; while (write_size < data_size) { - auto next_write_size = data_size - write_size < BUFFER_SIZE ? data_size - write_size : BUFFER_SIZE; + auto next_write_size = data_size - write_size < 4096 ? data_size - write_size : 4096; Review comment: I know it's old code, but this looks like `std::min(data_size - write_size, buffer.size())` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org