mirror of https://github.com/tqdm/tqdm.git
removed unnecessary exit optimisation (code duplication)
This commit is contained in:
parent
81b9f1f238
commit
35773af747
|
@ -306,8 +306,6 @@ class tqdm(object):
|
||||||
else:
|
else:
|
||||||
total = self.total
|
total = self.total
|
||||||
prefix = self.prefix
|
prefix = self.prefix
|
||||||
leave = self.leave
|
|
||||||
file = self.file
|
|
||||||
ncols = self.ncols
|
ncols = self.ncols
|
||||||
mininterval = self.mininterval
|
mininterval = self.mininterval
|
||||||
miniters = self.miniters
|
miniters = self.miniters
|
||||||
|
@ -337,18 +335,11 @@ class tqdm(object):
|
||||||
miniters = max(miniters, delta_it)
|
miniters = max(miniters, delta_it)
|
||||||
last_print_n = n
|
last_print_n = n
|
||||||
last_print_t = cur_t
|
last_print_t = cur_t
|
||||||
# Closing the progress bar
|
# Closing the progress bar.
|
||||||
# Note: does not call self.close() for speed optimisation.
|
# Update some internal variables for close().
|
||||||
if leave:
|
self.last_print_n = last_print_n
|
||||||
if last_print_n < n:
|
self.n = n
|
||||||
cur_t = time()
|
self.close()
|
||||||
sp(format_meter(
|
|
||||||
n, total, cur_t-start_t, ncols,
|
|
||||||
prefix, ascii, unit, unit_scale))
|
|
||||||
file.write('\n')
|
|
||||||
else:
|
|
||||||
sp('')
|
|
||||||
file.write('\r')
|
|
||||||
|
|
||||||
def update(self, n=1):
|
def update(self, n=1):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue