Skip to content

Commit

Permalink
[FOLD] clamp (WORKING)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Oct 20, 2016
1 parent f2be826 commit 0d79ea7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/beast/detail/zlib/basic_inflate_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ class basic_inflate_stream : public z_params
SYNC // looking for synchronization bytes to restart inflate()
};

template<class U1, class U2>
static
U1
clamp(U1 u1, U2 u2)
{
if(u1 > u2)
u1 = static_cast<U1>(u2);
return u1;
}

void
inflate_fast(z_stream& zs, unsigned start);

Expand Down

0 comments on commit 0d79ea7

Please sign in to comment.