Remove unnecessary asserts

This commit is contained in:
John Jones 2019-01-18 12:29:38 -05:00
parent b2e738af09
commit be4d480174
4 changed files with 0 additions and 11 deletions

View file

@ -25,7 +25,6 @@ namespace fc {
--_max_depth;
unsigned_int size; unpack( s, size, _max_depth );
value.clear();
FC_ASSERT( size.value*sizeof(T) < MAX_ARRAY_ALLOC_SIZE );
value.reserve( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint32_t i = 0; i < size.value; ++i )
{
@ -53,7 +52,6 @@ namespace fc {
--_max_depth;
unsigned_int size; unpack( s, size, _max_depth );
value.clear();
FC_ASSERT( size.value*(sizeof(K)+sizeof(V)) < MAX_ARRAY_ALLOC_SIZE );
value.reserve( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint32_t i = 0; i < size.value; ++i )
{

View file

@ -261,7 +261,6 @@ namespace fc {
template<typename Stream> inline void unpack( Stream& s, std::vector<char>& value, uint32_t _max_depth ) {
FC_ASSERT( _max_depth > 0 );
unsigned_int size; fc::raw::unpack( s, size, _max_depth - 1 );
FC_ASSERT( size.value < MAX_ARRAY_ALLOC_SIZE );
value.resize(size.value);
if( value.size() )
s.read( value.data(), value.size() );
@ -428,7 +427,6 @@ namespace fc {
--_max_depth;
unsigned_int size; fc::raw::unpack( s, size, _max_depth );
value.clear();
FC_ASSERT( size.value*sizeof(T) < MAX_ARRAY_ALLOC_SIZE );
value.reserve( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint32_t i = 0; i < size.value; ++i )
{
@ -474,7 +472,6 @@ namespace fc {
--_max_depth;
unsigned_int size; fc::raw::unpack( s, size, _max_depth );
value.clear();
FC_ASSERT( size.value*(sizeof(K)+sizeof(V)) < MAX_ARRAY_ALLOC_SIZE );
value.reserve( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint32_t i = 0; i < size.value; ++i )
{
@ -502,7 +499,6 @@ namespace fc {
--_max_depth;
unsigned_int size; fc::raw::unpack( s, size, _max_depth );
value.clear();
FC_ASSERT( size.value*(sizeof(K)+sizeof(V)) < MAX_ARRAY_ALLOC_SIZE );
for( uint32_t i = 0; i < size.value; ++i )
{
std::pair<K,V> tmp;
@ -529,7 +525,6 @@ namespace fc {
FC_ASSERT( _max_depth > 0 );
--_max_depth;
unsigned_int size; fc::raw::unpack( s, size, _max_depth );
FC_ASSERT( size.value*sizeof(T) < MAX_ARRAY_ALLOC_SIZE );
value.resize( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint64_t i = 0; i < size; i++ )
{
@ -557,7 +552,6 @@ namespace fc {
FC_ASSERT( _max_depth > 0 );
--_max_depth;
unsigned_int size; fc::raw::unpack( s, size, _max_depth );
FC_ASSERT( size.value*sizeof(T) < MAX_ARRAY_ALLOC_SIZE );
value.resize( std::min( size.value, FC_MAX_PREALLOC_SIZE ) );
for( uint64_t i = 0; i < size; i++ )
{

View file

@ -12,8 +12,6 @@
#include <unordered_map>
#include <set>
#define MAX_ARRAY_ALLOC_SIZE (1024*1024*10)
namespace fc {
class time_point;
class time_point_sec;

View file

@ -143,7 +143,6 @@ namespace fc { namespace raw {
--_max_depth;
unsigned_int vs;
unpack( s, vs, _max_depth );
FC_ASSERT( vs.value*sizeof(variant_object::entry) < MAX_ARRAY_ALLOC_SIZE );
mutable_variant_object mvo;
mvo.reserve( std::min( vs.value, FC_MAX_PREALLOC_SIZE ) );
for( uint32_t i = 0; i < vs.value; ++i )