Browse Source

prev has wrong push

pull/1/head
ZCWang 7 months ago
parent
commit
070b3cb6c6
  1. 4
      shared_module/container/detail/small_vector_base.hpp

4
shared_module/container/detail/small_vector_base.hpp

@ -245,7 +245,7 @@ public:
{ {
if (count <= N) { if (count <= N) {
if (size() > N) { if (size() > N) {
m_stack.assign(std::make_move_iterator(m_heap->begin()), std::make_move_iterator(m_heap->end())); m_stack.assign(std::make_move_iterator(m_heap->begin()), std::make_move_iterator(m_heap->begin() + count));
m_heap->clear(); m_heap->clear();
m_first = m_stack.begin(); m_first = m_stack.begin();
} else { } else {
@ -263,7 +263,7 @@ public:
{ {
if (count <= N) { if (count <= N) {
if (size() > N) { if (size() > N) {
m_stack.assign(std::make_move_iterator(m_heap->begin()), std::make_move_iterator(m_heap->end())); m_stack.assign(std::make_move_iterator(m_heap->begin()), std::make_move_iterator(m_heap->begin() + count));
m_heap->clear(); m_heap->clear();
m_first = m_stack.begin(); m_first = m_stack.begin();
} else { } else {

Loading…
Cancel
Save