Skip to content

Commit

Permalink
Remove an unnecessary std::max
Browse files Browse the repository at this point in the history
  • Loading branch information
kcat committed Dec 22, 2023
1 parent 863c48a commit aeb5361
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions alc/backends/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ uint BackendBase::availableSamples()

ClockLatency BackendBase::getClockLatency()
{
ClockLatency ret;
ClockLatency ret{};

uint refcount;
do {
Expand All @@ -58,8 +58,7 @@ ClockLatency BackendBase::getClockLatency()
* any given time during playback. Without a more accurate measurement from
* the output, this is an okay approximation.
*/
ret.Latency = std::max(std::chrono::seconds{mDevice->BufferSize-mDevice->UpdateSize},
std::chrono::seconds::zero());
ret.Latency = std::chrono::seconds{mDevice->BufferSize - mDevice->UpdateSize};
ret.Latency /= mDevice->Frequency;

return ret;
Expand Down

0 comments on commit aeb5361

Please sign in to comment.