Kaydet (Commit) 65e53990 authored tarafından Guido van Rossum's avatar Guido van Rossum

Don't write "if self.dict: self.dict.close()"; just write

"self.dict.close()" and ignore the exception.  The "if self.dict:"
part would be calculated through len(self.dict.keys()), which is very
expensive for a large dictionary...
üst 3ec38f0e
......@@ -75,8 +75,7 @@ class Shelf:
def close(self):
try:
if self.dict:
self.dict.close()
self.dict.close()
except:
pass
self.dict = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment