mirror of
https://github.com/python/cpython.git
synced 2025-11-07 09:02:02 +00:00
Don't call len() if the value is already cached! Caught by Gerrit
Holl <gerrit.holl@pobox.com>.
This commit is contained in:
parent
8972dfd58e
commit
fbff97a73b
1 changed files with 1 additions and 1 deletions
|
|
@ -141,7 +141,7 @@ def __format(self, object, stream, indent, allowance, context, level):
|
||||||
indent = indent + self.__indent_per_level
|
indent = indent + self.__indent_per_level
|
||||||
self.__format(object[0], stream, indent, allowance + 1,
|
self.__format(object[0], stream, indent, allowance + 1,
|
||||||
context, level)
|
context, level)
|
||||||
if len(object) > 1:
|
if length > 1:
|
||||||
for ent in object[1:]:
|
for ent in object[1:]:
|
||||||
stream.write(',\n' + ' '*indent)
|
stream.write(',\n' + ' '*indent)
|
||||||
self.__format(ent, stream, indent,
|
self.__format(ent, stream, indent,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue