Optimization: Use constant folding for divisions not a power of two (#9609)

This commit is contained in:
zwim
2022-10-10 22:21:27 +02:00
committed by GitHub
parent a24548ed3f
commit 4969811c08
40 changed files with 118 additions and 118 deletions

View File

@@ -45,8 +45,8 @@ end
function ReadTimer:remainingTime()
if self:scheduled() then
local remainder = self:remaining()
local hours = math.floor(remainder / 3600)
local minutes = math.floor(remainder % 3600 / 60)
local hours = math.floor(remainder * (1/3600))
local minutes = math.floor(remainder % 3600 * (1/60))
local seconds = math.floor(remainder % 60)
return hours, minutes, seconds
end