mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Hoist variable definition outside loop since it is used outside loop
This commit is contained in:
parent
ed21a72eae
commit
bca1ef5767
@ -878,9 +878,7 @@ def at_current(): # {{{
|
||||
def at_point_vertical_mode(i, b):
|
||||
return at_point(b, i)
|
||||
|
||||
at_point_conditional = at_point
|
||||
if scroll_viewport.vertical_writing_mode:
|
||||
at_point_conditional = at_point_vertical_mode
|
||||
at_point_conditional = at_point_vertical_mode if scroll_viewport.vertical_writing_mode else at_point
|
||||
|
||||
def i_loop(curb):
|
||||
curi = starti
|
||||
@ -894,10 +892,9 @@ def at_current(): # {{{
|
||||
curi += deltai
|
||||
|
||||
curb = startb
|
||||
while low_boundb <= curb <= up_boundb:
|
||||
cfi = None
|
||||
while low_boundb <= curb <= up_boundb and not cfi:
|
||||
cfi = i_loop(curb)
|
||||
if cfi:
|
||||
break
|
||||
curb += deltab
|
||||
|
||||
if cfi:
|
||||
|
Loading…
x
Reference in New Issue
Block a user