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:
@@ -385,7 +385,7 @@ function ReaderScrolling:_setupAction()
|
||||
local dist = math.floor(self._velocity * self._inertial_scroll_interval)
|
||||
if math.abs(dist) < self.end_scroll_dist then
|
||||
-- Decrease it even more so scrolling stops sooner
|
||||
self._velocity = self._velocity / 1.5
|
||||
self._velocity = self._velocity * (2/3)
|
||||
end
|
||||
-- self._stats_scroll_iterations = self._stats_scroll_iterations + 1
|
||||
-- self._stats_scroll_distance = self._stats_scroll_distance + dist
|
||||
|
||||
Reference in New Issue
Block a user