Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine syntax: expose overloaded inherited functions #376

Merged
merged 1 commit into from
Nov 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cfgmgr/intfmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class IntfMgr : public Orch
{
public:
IntfMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames);
using Orch::doTask;

private:
ProducerStateTable m_appIntfTableProducer;
Expand Down
2 changes: 1 addition & 1 deletion cfgmgr/intfmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main(int argc, char **argv)
}
if (ret == Select::TIMEOUT)
{
((Orch *)&intfmgr)->doTask();
intfmgr.doTask();
continue;
}

Expand Down
3 changes: 1 addition & 2 deletions cfgmgr/vlanmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,11 @@ bool VlanMgr::removeHostVlanMember(int vlan_id, const string &port_alias)

bool VlanMgr::isVlanMacOk()
{
return !(!gMacAddress);
return !!gMacAddress;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know i'm late for this one, but i just noticed it now. Why would you change from the previous readable notation to this unintuitive one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary parentheses make the previous code less readable, and less intuitive.

}

void VlanMgr::doVlanTask(Consumer &consumer)
{

if (!isVlanMacOk())
{
SWSS_LOG_DEBUG("VLAN mac not ready, delaying VLAN task");
Expand Down
1 change: 1 addition & 0 deletions cfgmgr/vlanmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class VlanMgr : public Orch
{
public:
VlanMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const vector<string> &tableNames);
using Orch::doTask;

private:
ProducerStateTable m_appVlanTableProducer, m_appVlanMemberTableProducer;
Expand Down
2 changes: 1 addition & 1 deletion cfgmgr/vlanmgrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ int main(int argc, char **argv)
}
if (ret == Select::TIMEOUT)
{
((Orch *)&vlanmgr)->doTask();
vlanmgr.doTask();
continue;
}

Expand Down