Skip to content

Commit

Permalink
MythPower: Use std::max_element (per cppcheck)
Browse files Browse the repository at this point in the history
(cherry picked from commit bb428c6)
  • Loading branch information
mark-kendall committed Feb 28, 2020
1 parent 2d348e0 commit 7b91aa9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mythtv/libs/libmythbase/mythpower.cpp
Expand Up @@ -110,10 +110,7 @@ MythPower* MythPower::AcquireRelease(void *Reference, bool Acquire, uint Minimum
if (s_instance)
{
// Update the maximum requested delay
uint max = 0;
foreach (uint delay, s_delays)
if (delay > max)
max = delay;
uint max = std::max_element(s_delays.cbegin(), s_delays.cend()).value();
s_instance->SetRequestedDelay(max);
}
return s_instance;
Expand Down

0 comments on commit 7b91aa9

Please sign in to comment.