Improve and simplify code with modern C++ features
Change-Id: I83bf5513c2a1f90ba5a59e93c473306864b27d94
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 1928bf5..7494ca7 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -57,11 +57,6 @@
1 + 1 + 8 + // FragCount TLV
1 + 9; // Fragment TLV-TYPE and TLV-LENGTH
-LpFragmenter::Options::Options()
- : nMaxFragments(400)
-{
-}
-
LpFragmenter::LpFragmenter(const LpFragmenter::Options& options, const LinkService* linkService)
: m_options(options)
, m_linkService(linkService)
@@ -122,7 +117,7 @@
// compute FragCount
if (fragCount > m_options.nMaxFragments) {
NFD_LOG_FACE_WARN("fragmentation error, FragCount over limit: DROP");
- return std::make_pair(false, std::vector<lp::Packet>{});
+ return std::make_tuple(false, std::vector<lp::Packet>{});
}
// populate fragments
@@ -135,7 +130,7 @@
lp::Packet& frag = frags[fragIndex];
frag.add<lp::FragIndexField>(fragIndex);
frag.add<lp::FragCountField>(fragCount);
- frag.set<lp::FragmentField>(std::make_pair(fragBegin, fragEnd));
+ frag.set<lp::FragmentField>({fragBegin, fragEnd});
BOOST_ASSERT(frag.wireEncode().size() <= mtu);
++fragIndex;
@@ -144,7 +139,7 @@
}
BOOST_ASSERT(fragIndex == fragCount);
- return std::make_pair(true, frags);
+ return std::make_tuple(true, frags);
}
std::ostream&