From a71a6ecec22d196b210dd69630bb16153530a5c0 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 2 Jan 2017 19:22:36 +0000 Subject: [PATCH] Fix Pop() method of SmallStack/StationIDStack. Fixes 8deac54c --- src/core/smallstack_type.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/smallstack_type.hpp b/src/core/smallstack_type.hpp index 99ad5d1268..35ac0106b1 100644 --- a/src/core/smallstack_type.hpp +++ b/src/core/smallstack_type.hpp @@ -211,7 +211,9 @@ public: _pool.Destroy(this->next); } else { --popped.branch_count; - this->Branch(); + if (popped.next != Tmax_size) { + ++(_pool.Get(popped.next).branch_count); + } } /* Accessing popped here is no problem as the pool will only set * the validity flag, not actually delete the item, on Destroy().