Permalink
Browse files

fix incorrect asserts

  • Loading branch information...
janusheide committed Nov 10, 2017
1 parent 40e7d15 commit b85cdd7d3c1179dd8e58aaab2a358c7e6381f6e2
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/endian/stream_reader.hpp
@@ -47,7 +47,7 @@ class stream_reader : public stream
template<uint8_t Bytes, class ValueType>
void read_bytes(ValueType& value)
{
assert(sizeof(ValueType) <= remaining_size() &&
assert(Bytes <= remaining_size() &&
"Reading over the end of the underlying buffer");
// Get the value at the current position
@@ -113,8 +113,7 @@ class stream_reader : public stream
template<uint8_t Bytes, class ValueType>
void peek_bytes(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
assert(Bytes <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");
const uint8_t* data_position = remaining_data() + offset;
@@ -130,7 +129,6 @@ class stream_reader : public stream
template<class ValueType>
void peek(ValueType& value, uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");
@@ -145,7 +143,6 @@ class stream_reader : public stream
template<class ValueType>
ValueType peek(uint64_t offset=0) const
{
assert(remaining_size() >= offset && "Offset too large");
assert(sizeof(ValueType) <= remaining_size() - offset &&
"Reading over the end of the underlying buffer");

0 comments on commit b85cdd7

Please sign in to comment.