summaryrefslogtreecommitdiff
path: root/redfish-core/lib/ethernet.hpp
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2022-01-25 21:19:23 +0300
committerEd Tanous <ed@tanous.net>2022-02-09 23:45:00 +0300
commit9eb808c1a84a76e92b0e01fa95d3f160f38d7c3f (patch)
treef3631a3f2a97fb0f048fb1dd5d295b867e8d37fc /redfish-core/lib/ethernet.hpp
parentb3db89663256a462e9c90bf260d5058014765137 (diff)
downloadbmcweb-9eb808c1a84a76e92b0e01fa95d3f160f38d7c3f.tar.xz
Enable readability-avoid-const-params-in-decls
This check involves explicitly declaring variables const when they're declared auto, which helps in readability, and makes it more clear that the variables are const. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I71198ea03850384a389a56ad26f2c4a48c75b148
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r--redfish-core/lib/ethernet.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index e4e5eb9d62..f4260a8217 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -450,7 +450,7 @@ inline void
// Check if proper pattern for object path appears
if (boost::starts_with(objpath.first.str, ipv6PathStart))
{
- for (auto& interface : objpath.second)
+ for (const auto& interface : objpath.second)
{
if (interface.first == "xyz.openbmc_project.Network.IP")
{
@@ -463,7 +463,7 @@ inline void
IPv6AddressData& ipv6Address = *it.first;
ipv6Address.id =
objpath.first.str.substr(ipv6PathStart.size());
- for (auto& property : interface.second)
+ for (const auto& property : interface.second)
{
if (property.first == "Address")
{
@@ -528,7 +528,7 @@ inline void
// Check if proper pattern for object path appears
if (boost::starts_with(objpath.first.str, ipv4PathStart))
{
- for (auto& interface : objpath.second)
+ for (const auto& interface : objpath.second)
{
if (interface.first == "xyz.openbmc_project.Network.IP")
{
@@ -541,7 +541,7 @@ inline void
IPv4AddressData& ipv4Address = *it.first;
ipv4Address.id =
objpath.first.str.substr(ipv4PathStart.size());
- for (auto& property : interface.second)
+ for (const auto& property : interface.second)
{
if (property.first == "Address")
{
@@ -1782,7 +1782,7 @@ inline void parseInterfaceData(
nlohmann::json& ipv4StaticArray = jsonResponse["IPv4StaticAddresses"];
ipv4Array = nlohmann::json::array();
ipv4StaticArray = nlohmann::json::array();
- for (auto& ipv4Config : ipv4Data)
+ for (const auto& ipv4Config : ipv4Data)
{
std::string gatewayStr = ipv4Config.gateway;
@@ -1819,7 +1819,7 @@ inline void parseInterfaceData(
nlohmann::json& ipv6AddrPolicyTable =
jsonResponse["IPv6AddressPolicyTable"];
ipv6AddrPolicyTable = nlohmann::json::array();
- for (auto& ipv6Config : ipv6Data)
+ for (const auto& ipv6Config : ipv6Data)
{
ipv6Array.push_back({{"Address", ipv6Config.address},
{"PrefixLength", ipv6Config.prefixLength},