From 54ac38bfd8546896ccaa86ffd40827eace448f53 Mon Sep 17 00:00:00 2001 From: John Hood Date: Sun, 7 May 2017 16:52:30 -0400 Subject: [PATCH] remove unneeded new/delete in Compressor --- src/network/compressor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/compressor.h b/src/network/compressor.h index dd2da6d..26b2cd6 100644 --- a/src/network/compressor.h +++ b/src/network/compressor.h @@ -40,11 +40,11 @@ namespace Network { private: static const int BUFFER_SIZE = 2048 * 2048; /* effective limit on terminal size */ - unsigned char *buffer; + unsigned char buffer[BUFFER_SIZE]; public: - Compressor() : buffer( NULL ) { buffer = new unsigned char[ BUFFER_SIZE ]; } - ~Compressor() { if ( buffer ) { delete[] buffer; } } + Compressor() {} + ~Compressor() {} std::string compress_str( const std::string &input ); std::string uncompress_str( const std::string &input );