-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
From a code review: https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-power/+/52148/2..4/phosphor-power-supply/power_supply.cpp#b178
@smccarney said:
There are a few issues with passing data members as parameters, such as:
- Makes the code confusing. What is the value of parameter shortName vs. data member shortName? Why do both exist?
- The parameter hides the data member in the method.
There are a few cases where it can make sense, but in general I think it is something to be avoided.
https://github.com/openbmc/phosphor-power/blob/master/phosphor-power-supply/util_base.hpp
https://github.com/openbmc/phosphor-power/blob/master/phosphor-power-supply/util.hpp
https://github.com/openbmc/phosphor-power/blob/master/phosphor-power-supply/test/mock.hpp
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels