Optimization: Use constant folding for divisions not a power of two (#9609)
This commit is contained in:
40 files changed
+118
-118
No files matched your search
@@ -433,10 +433,10 @@ function ReaderMenu:_getTabIndexFromLocation(ges)
|
||||
if not ges then
|
||||
return self.last_tab_index
|
||||
-- if the start position is far right
|
||||
elseif ges.pos.x > 2 * Screen:getWidth() / 3 then
|
||||
elseif ges.pos.x > Screen:getWidth() * (2/3) then
|
||||
return BD.mirroredUILayout() and 1 or #self.tab_item_table
|
||||
-- if the start position is far left
|
||||
elseif ges.pos.x < Screen:getWidth() / 3 then
|
||||
elseif ges.pos.x < Screen:getWidth() * (1/3) then
|
||||
return BD.mirroredUILayout() and #self.tab_item_table or 1
|
||||
-- if center return the last index
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user