@@ -204,7 +204,7 @@ namespace SharedUtil
204204 return result;
205205 }
206206
207- inline bool StringToZLibFormat (const std::string format, int & outResult)
207+ inline bool StringToZLibFormat (const std::string& format, int & outResult)
208208 {
209209 int value = atoi (format.c_str ());
210210 if ((value >= 9 && value <= 31 ) || (value >= -15 && value <= -9 )) // allowed values: 9..31, -9..-15
@@ -215,7 +215,7 @@ namespace SharedUtil
215215 return false ;
216216 }
217217
218- inline int ZLibCompress (const std::string input, std::string* output, const int windowBits = (int )ZLibFormat::GZIP, const int compression = 9,
218+ inline int ZLibCompress (const std::string& input, std::string& output, const int windowBits = (int )ZLibFormat::GZIP, const int compression = 9,
219219 const ZLibStrategy strategy = ZLibStrategy::DEFAULT)
220220 {
221221 z_stream stream{};
@@ -224,10 +224,10 @@ namespace SharedUtil
224224 if (result != Z_OK)
225225 return result;
226226
227- output-> resize (deflateBound (&stream, input.size ())); // resize to the upper bound of what the compressed size might be
227+ output. resize (deflateBound (&stream, input.size ())); // resize to the upper bound of what the compressed size might be
228228
229- stream.next_out = (Bytef*)output-> data ();
230- stream.avail_out = output-> size ();
229+ stream.next_out = (Bytef*)output. data ();
230+ stream.avail_out = output. size ();
231231
232232 stream.next_in = (z_const Bytef*)input.data ();
233233 stream.avail_in = input.size ();
@@ -236,12 +236,12 @@ namespace SharedUtil
236236 result |= deflateEnd (&stream);
237237
238238 if (result == Z_STREAM_END)
239- output-> resize (stream.total_out ); // resize to the actual size
239+ output. resize (stream.total_out ); // resize to the actual size
240240
241241 return result;
242242 }
243243
244- inline int ZLibUncompress (const std::string& input, std::string* output, int windowBits = 0 )
244+ inline int ZLibUncompress (const std::string& input, std::string& output, int windowBits = 0 )
245245 {
246246 if (windowBits == 0 && input.size () >= 2 ) // try to determine format automatically
247247 {
@@ -273,7 +273,7 @@ namespace SharedUtil
273273 if (result != Z_OK && result != Z_STREAM_END)
274274 break ;
275275
276- output-> append (buffer, 0 , stream.total_out - output-> size ()); // append only what was written to buffer
276+ output. append (buffer, 0 , stream.total_out - output. size ()); // append only what was written to buffer
277277
278278 if (result == Z_STREAM_END)
279279 break ;
0 commit comments