diff options
author | William A. Kennington III <wak@google.com> | 2018-10-30 19:53:16 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2018-11-06 18:58:45 +0000 |
commit | 0420a9324f39c887029a293212f81231b4278b88 (patch) | |
tree | c4ad3fa6707ddf2b82f8996c8e6c3ba47fda92fa /control | |
parent | 33bfe76177df0b91a33b75bc33759977ba55ff5c (diff) | |
download | phosphor-fan-presence-0420a9324f39c887029a293212f81231b4278b88.tar.gz phosphor-fan-presence-0420a9324f39c887029a293212f81231b4278b88.zip |
control/zone: Use const references when iterating
We don't want to copy the object out of the container we are iterating
over.
Tested:
Built and run through unit tests.
Change-Id: I68b041f98e1c6a6a9dbc59448b629e1d22ba62c9
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to 'control')
-rw-r--r-- | control/zone.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/control/zone.cpp b/control/zone.cpp index d37701e..7b19acc 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -419,7 +419,7 @@ std::vector<TimerEvent>::iterator Zone::findTimer( { for (auto it = _timerEvents.begin(); it != _timerEvents.end(); ++it) { - auto teEventData = *std::get<timerEventDataPos>(*it); + const auto& teEventData = *std::get<timerEventDataPos>(*it); if (std::get<eventActionsPos>(teEventData).size() == eventActions.size()) { |