Skip to content

Commit a889ec0

Browse files
committed
Remove unused recursion depth tracking in ship.
1 parent dd567a6 commit a889ec0

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,6 @@ def ship(ox, oy, box):
17011701
processes have become local variables here.
17021702
"""
17031703

1704-
max_push = 0 # Deepest nesting of push commands so far
1705-
cur_s = 0
17061704
cur_v = 0.
17071705
cur_h = 0.
17081706
off_h = ox
@@ -1716,16 +1714,14 @@ def clamp(value):
17161714
return value
17171715

17181716
def hlist_out(box):
1719-
nonlocal max_push, cur_s, cur_v, cur_h, off_h, off_v
1717+
nonlocal cur_v, cur_h, off_h, off_v
17201718

17211719
cur_g = 0
17221720
cur_glue = 0.
17231721
glue_order = box.glue_order
17241722
glue_sign = box.glue_sign
17251723
base_line = cur_v
17261724
left_edge = cur_h
1727-
cur_s += 1
1728-
max_push = max(cur_s, max_push)
17291725

17301726
for p in box.children:
17311727
if isinstance(p, Char):
@@ -1776,17 +1772,14 @@ def hlist_out(box):
17761772
cur_g = round(clamp(box.glue_set * cur_glue))
17771773
rule_width += cur_g
17781774
cur_h += rule_width
1779-
cur_s -= 1
17801775

17811776
def vlist_out(box):
1782-
nonlocal max_push, cur_s, cur_v, cur_h, off_h, off_v
1777+
nonlocal cur_v, cur_h, off_h, off_v
17831778

17841779
cur_g = 0
17851780
cur_glue = 0.
17861781
glue_order = box.glue_order
17871782
glue_sign = box.glue_sign
1788-
cur_s += 1
1789-
max_push = max(max_push, cur_s)
17901783
left_edge = cur_h
17911784
cur_v -= box.height
17921785
top_edge = cur_v
@@ -1835,7 +1828,6 @@ def vlist_out(box):
18351828
elif isinstance(p, Char):
18361829
raise RuntimeError(
18371830
"Internal mathtext error: Char node found in vlist")
1838-
cur_s -= 1
18391831

18401832
hlist_out(box)
18411833

0 commit comments

Comments
 (0)