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):
|
def at_point_vertical_mode(i, b):
|
||||||
return at_point(b, i)
|
return at_point(b, i)
|
||||||
|
|
||||||
at_point_conditional = at_point
|
at_point_conditional = at_point_vertical_mode if scroll_viewport.vertical_writing_mode else at_point
|
||||||
if scroll_viewport.vertical_writing_mode:
|
|
||||||
at_point_conditional = at_point_vertical_mode
|
|
||||||
|
|
||||||
def i_loop(curb):
|
def i_loop(curb):
|
||||||
curi = starti
|
curi = starti
|
||||||
@ -894,10 +892,9 @@ def at_current(): # {{{
|
|||||||
curi += deltai
|
curi += deltai
|
||||||
|
|
||||||
curb = startb
|
curb = startb
|
||||||
while low_boundb <= curb <= up_boundb:
|
cfi = None
|
||||||
|
while low_boundb <= curb <= up_boundb and not cfi:
|
||||||
cfi = i_loop(curb)
|
cfi = i_loop(curb)
|
||||||
if cfi:
|
|
||||||
break
|
|
||||||
curb += deltab
|
curb += deltab
|
||||||
|
|
||||||
if cfi:
|
if cfi:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user