Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 911cb37

Browse files
committed
minor cleanup; create list instead of appending repeatedly
1 parent b1723b6 commit 911cb37

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

lib/matplotlib/_mathtext.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,19 +2771,18 @@ def _genfrac(self, ldelim, rdelim, rule, style, num, den):
27712771
cnum.hpack(width, 'exactly')
27722772
cden.hpack(width, 'exactly')
27732773

2774-
vlist_builder = []
27752774
if cnum.height < cap_height:
27762775
cnum.height = cap_height
2777-
vlist_builder.append(cnum)
27782776
numerator_padding = max(
2779-
cap_height * 3/5 - cnum.depth, min_clearance) - thickness
2780-
vlist_builder.append(Vbox(0, numerator_padding))
2781-
vlist_builder.append(Hrule(state, rule))
2777+
3/5 * cap_height - cnum.depth, min_clearance) - thickness
27822778
denominator_padding = max(
27832779
4/3 * cap_height - cden.height, min_clearance) + thickness
2784-
vlist_builder.append(Vbox(0, denominator_padding))
2785-
vlist_builder.append(cden)
2786-
vlist = Vlist(vlist_builder)
2780+
vlist = Vlist([cnum, # numerator
2781+
Vbox(0, numerator_padding), # space
2782+
Hrule(state, rule), # rule
2783+
Vbox(0, denominator_padding), # space
2784+
cden # denominator
2785+
])
27872786

27882787
# Shift so the fraction line sits in the middle of the
27892788
# minus sign

0 commit comments

Comments
 (0)