name-prefix-list: compare names only in operator==
NamePrefixList type is now a sorted container. The sort() method is
deleted.
The remove() method is renamed to erase(), in accordance with ndn-cxx
code style recommendations.
refs #4094
Change-Id: I2d3f2fa768a8dd9a51108f6f4064243b21fd6df8
diff --git a/src/lsa/name-lsa.cpp b/src/lsa/name-lsa.cpp
index 90f946f..50e4cb7 100644
--- a/src/lsa/name-lsa.cpp
+++ b/src/lsa/name-lsa.cpp
@@ -138,9 +138,6 @@
auto nlsa = std::static_pointer_cast<NameLsa>(lsa);
bool updated = false;
- m_npl.sort();
- nlsa->getNpl().sort();
-
// Obtain the set difference of the current and the incoming
// name prefix sets, and add those.
std::list<ndn::Name> newNames = nlsa->getNpl().getNames();
@@ -153,8 +150,6 @@
updated = true;
}
- m_npl.sort();
-
// Also remove any names that are no longer being advertised.
std::list<ndn::Name> namesToRemove;
std::set_difference(oldNames.begin(), oldNames.end(), newNames.begin(), newNames.end(),
diff --git a/src/lsa/name-lsa.hpp b/src/lsa/name-lsa.hpp
index 1705abc..5e4cfa6 100644
--- a/src/lsa/name-lsa.hpp
+++ b/src/lsa/name-lsa.hpp
@@ -78,7 +78,7 @@
removeName(const ndn::Name& name)
{
m_wire.reset();
- m_npl.remove(name);
+ m_npl.erase(name);
}
bool