Skip to content

Commit

Permalink
Rewrite the logic to avoid affecting cases where max < min for some r…
Browse files Browse the repository at this point in the history
…eason; bad configuration should not be masked
  • Loading branch information
confluence committed Apr 20, 2024
1 parent 66ed790 commit b5262d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/powerkit_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@ const QPair<int, QString> Cpu::getCpuFreqLabel()
int freqMin = Cpu::getMinFrequency();
int freqMax = Cpu::getMaxFrequency();
int progress;
if (freqMax > freqMin) {
progress = ((currentCpuFreq - freqMin) * 100) / (freqMax - freqMin);
} else {
if (freqMax == freqMin) {
progress = 100;
} else {
progress = ((currentCpuFreq - freqMin) * 100) / (freqMax - freqMin);
}

result.first = progress;
Expand Down

0 comments on commit b5262d6

Please sign in to comment.