Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved list sort out of loop to not waste time sorting. #1331

Merged
merged 1 commit into from
Mar 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/afdko/checkoutlinesufo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,9 +1030,11 @@ def run(args=None):

max_length = max([len(g) for g in glyph_list])
fmt = '{:<%d}' % max_length
with trange(len(glyph_list)) as t:
glyph_list = sorted(glyph_list)
list_length = len(glyph_list)
with trange(list_length) as t:
for i in t:
glyph_name = sorted(glyph_list)[i]
glyph_name = glyph_list[i]
t.set_description('Checking outlines for %s' %
fmt.format(glyph_name))
changed = False
Expand Down Expand Up @@ -1108,7 +1110,7 @@ def run(args=None):
# The following is needed when the script is called from another
# script with Popen():
sys.stdout.flush()
if i == len(glyph_list) - 1:
if i == list_length - 1:
t.set_description("Finished checkoutlinesufo")

# update layer plist: the hash check call may have deleted processed layer
Expand Down