Reduce usage of std::bind()
C++14 lambdas are easier to read, easier to debug,
and can usually be better optimized by the compiler.
Change-Id: I294f275904f91942a8de946fe63e77078a7608a6
diff --git a/daemon/table/network-region-table.cpp b/daemon/table/network-region-table.cpp
index c7e9cea..4ede386 100644
--- a/daemon/table/network-region-table.cpp
+++ b/daemon/table/network-region-table.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-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,10 +28,10 @@
namespace nfd {
bool
-NetworkRegionTable::isInProducerRegion(const DelegationList& forwardingHint) const
+NetworkRegionTable::isInProducerRegion(const ndn::DelegationList& forwardingHint) const
{
for (const Name& regionName : *this) {
- for (const Delegation& delegation : forwardingHint) {
+ for (const auto& delegation : forwardingHint) {
if (delegation.name.isPrefixOf(regionName)) {
return true;
}
diff --git a/daemon/table/network-region-table.hpp b/daemon/table/network-region-table.hpp
index 22da902..e531a45 100644
--- a/daemon/table/network-region-table.hpp
+++ b/daemon/table/network-region-table.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,8 @@
#include "core/common.hpp"
+#include <ndn-cxx/delegation-list.hpp>
+
namespace nfd {
/** \brief stores a collection of producer region names
@@ -50,7 +52,7 @@
* otherwise, the Interest should be forwarded according to the forwarding hint.
*/
bool
- isInProducerRegion(const DelegationList& forwardingHint) const;
+ isInProducerRegion(const ndn::DelegationList& forwardingHint) const;
};
} // namespace nfd