table: add more `noexcept`
Also merge fib-nexthop.hpp into fib-entry.hpp
Change-Id: Iec2fb90ede446f5b8d326c882904c70db45b87d6
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index cb97ea2..3ca8def 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2022, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,16 +33,14 @@
}
NextHopList::iterator
-Entry::findNextHop(const Face& face)
+Entry::findNextHop(const Face& face) noexcept
{
return std::find_if(m_nextHops.begin(), m_nextHops.end(),
- [&face] (const NextHop& nexthop) {
- return &nexthop.getFace() == &face;
- });
+ [&face] (const NextHop& nexthop) { return &nexthop.getFace() == &face; });
}
bool
-Entry::hasNextHop(const Face& face) const
+Entry::hasNextHop(const Face& face) const noexcept
{
return const_cast<Entry*>(this)->findNextHop(face) != m_nextHops.end();
}
@@ -50,7 +48,7 @@
std::pair<NextHopList::iterator, bool>
Entry::addOrUpdateNextHop(Face& face, uint64_t cost)
{
- auto it = this->findNextHop(face);
+ auto it = findNextHop(face);
bool isNew = false;
if (it == m_nextHops.end()) {
m_nextHops.emplace_back(face);
@@ -67,7 +65,7 @@
bool
Entry::removeNextHop(const Face& face)
{
- auto it = this->findNextHop(face);
+ auto it = findNextHop(face);
if (it != m_nextHops.end()) {
m_nextHops.erase(it);
return true;