Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
liuh-80 committed Sep 27, 2024
1 parent b460a3a commit cc046bd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cfgmgr/portmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,25 +183,23 @@ void PortMgr::doTask(Consumer &consumer)
if (fvField(i) == "mtu")
{
mtu = fvValue(i);
if (!portOk)
{
field_values.emplace_back(i);
}
}
else if (fvField(i) == "admin_status")
{
admin_status = fvValue(i);
if (!portOk)
{
field_values.emplace_back(i);
}
}
else
{
field_values.emplace_back(i);
}
}

if (!portOk)
{
field_values.emplace_back("mtu", mtu);
field_values.emplace_back("admin_status", admin_status);
}

if (field_values.size())
{
writeConfigToAppDb(alias, field_values);
Expand Down

0 comments on commit cc046bd

Please sign in to comment.