diff --git a/test/expand_bwd_test_allocator.hpp b/test/expand_bwd_test_allocator.hpp index 60b3283..4d50fbb 100644 --- a/test/expand_bwd_test_allocator.hpp +++ b/test/expand_bwd_test_allocator.hpp @@ -142,15 +142,12 @@ class expand_bwd_test_allocator reuse = 0; return (mp_buffer + m_offset); } - else if(m_allocations == 1){ - if(limit_size > m_size){ - assert(0); - } - ++m_allocations; - return mp_buffer; - } else{ - throw_bad_alloc(); + if(m_allocations != 1){ + throw_bad_alloc(); + } + assert(limit_size <= m_size); + ++m_allocations; return mp_buffer; } }