Skip to content

Commit 0a761ed

Browse files
committed
No need to cast to floats with future division
1 parent adbeaaf commit 0a761ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/font_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,12 +1070,12 @@ def score_family(self, families, family2):
10701070
options = [x.lower() for x in options]
10711071
if family2 in options:
10721072
idx = options.index(family2)
1073-
return ((0.1 * (float(idx) / len(options))) *
1074-
(float(i + 1) / float(len(families))))
1073+
return ((0.1 * (idx / len(options))) *
1074+
((i + 1) / len(families)))
10751075
elif family1 == family2:
10761076
# The score should be weighted by where in the
10771077
# list the font was found.
1078-
return float(i) / float(len(families))
1078+
return i / len(families)
10791079
return 1.0
10801080

10811081
def score_style(self, style1, style2):

0 commit comments

Comments
 (0)