Convert to span and avoid deprecated ndn-cxx functions
Change-Id: I45c50527fe53498b53a3d951458bdff8e7d7778c
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index d19f799..77a7120 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -69,10 +69,9 @@
// check for fast path
if (fragIndex == 0 && fragCount == 1) {
- ndn::Buffer::const_iterator fragBegin, fragEnd;
- std::tie(fragBegin, fragEnd) = packet.get<lp::FragmentField>();
- Block netPkt(&*fragBegin, std::distance(fragBegin, fragEnd));
- return std::make_tuple(true, netPkt, packet);
+ auto frag = packet.get<lp::FragmentField>();
+ Block netPkt({frag.first, frag.second});
+ return {true, netPkt, packet};
}
// check Sequence and compute message identifier
@@ -140,7 +139,7 @@
it = std::copy(fragBegin, fragEnd, it);
}
- return Block(&*(fragBuffer.cbegin()), std::distance(fragBuffer.cbegin(), fragBuffer.cend()));
+ return Block(fragBuffer);
}
void