table: erase NameTree entry when FIB/Measurements/StrategyChoice entry is erased
This commit also optimizes Measurements table to make use of NameTree shortcuts.
refs #1803
Change-Id: Ib0e465750ed5e8ff9ed129a926a7bc852db4e9e1
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index 34c583e..aa5db1b 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.cpp
@@ -21,7 +21,7 @@
*
* You should have received a copy of the GNU General Public License along with
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
#include "strategy-choice.hpp"
#include "core/logger.hpp"
@@ -120,6 +120,7 @@
this->changeStrategy(entry, oldStrategy.shared_from_this(), parentStrategy.shared_from_this());
nameTreeEntry->setStrategyChoiceEntry(shared_ptr<Entry>());
+ m_nameTree.eraseEntryIfEmpty(nameTreeEntry);
--m_nItems;
}