mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Optimization: Use constant folding for divisions not a power of two (#9609)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user