Fix std::max() call in Compression.cpp
authorNick Terrell <terrelln@fb.com>
Mon, 10 Apr 2017 20:44:04 +0000 (13:44 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 10 Apr 2017 20:51:28 +0000 (13:51 -0700)
Summary:
`std::max(uint64_t, size_t)` was called.
Fixes https://github.com/facebook/folly/issues/576.

Reviewed By: Orvid

Differential Revision: D4861336

fbshipit-source-id: 1b6f67b291451048ba79d638d2c1184f9245dc0c

folly/io/Compression.cpp

index 90235c6..ae75b2a 100644 (file)
@@ -565,7 +565,8 @@ std::unique_ptr<IOBuf> LZ4FrameCodec::doUncompress(
     growthSize = std::min(uncompressedLength, growthSize);
   } else {
     // Reduce growthSize for small data
-    const auto guessUncompressedLen = 4 * std::max(blockSize, in.size());
+    const auto guessUncompressedLen =
+        4 * std::max<uint64_t>(blockSize, in.size());
     growthSize = std::min(guessUncompressedLen, growthSize);
   }
   // Once LZ4_decompress() is called, the dctx_ cannot be reused until it