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:
@@ -123,7 +123,7 @@ function ReaderThumbnail:setupCache()
|
||||
local max_bytes = math.ceil(N * Screen:getWidth() * Screen:getHeight() * Blitbuffer.TYPE_TO_BPP[self.bb_type] / 8)
|
||||
-- We don't really care about limiting any number of slots, so allow
|
||||
-- for at least 5 pages of 10x10 tiles
|
||||
local avg_itemsize = math.ceil(max_bytes / 500)
|
||||
local avg_itemsize = math.ceil(max_bytes * (1/500))
|
||||
self.tile_cache = Cache:new{
|
||||
size = max_bytes,
|
||||
avg_itemsize = avg_itemsize, -- will make slots=500
|
||||
|
||||
Reference in New Issue
Block a user