From: Nick Terrell Date: Mon, 10 Apr 2017 20:44:04 +0000 (-0700) Subject: Fix std::max() call in Compression.cpp X-Git-Tag: v2017.04.17.00~43 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=03ce292a000fb616c12e2aca2a38b7b26e6ef050;p=folly.git Fix std::max() call in Compression.cpp 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 --- diff --git a/folly/io/Compression.cpp b/folly/io/Compression.cpp index 90235c66..ae75b2a6 100644 --- a/folly/io/Compression.cpp +++ b/folly/io/Compression.cpp @@ -565,7 +565,8 @@ std::unique_ptr 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(blockSize, in.size()); growthSize = std::min(guessUncompressedLen, growthSize); } // Once LZ4_decompress() is called, the dctx_ cannot be reused until it