Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Unified Diff: Lib/filecmp.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/email/utils.py ('k') | Lib/ftplib.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/filecmp.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/filecmp.py Mon Jul 25 09:47:18 2011 -0400
@@ -48,12 +48,11 @@
if s1[1] != s2[1]:
return False
- outcome = _cache.get((f1, f2, s1, s2))
- if outcome is None:
- outcome = _do_cmp(f1, f2)
- if len(_cache) > 100: # limit the maximum size of the cache
- _cache.clear()
- _cache[f1, f2, s1, s2] = outcome
+ result = _cache.get((f1, f2))
+ if result and (s1, s2) == result[:2]:
+ return result[2]
+ outcome = _do_cmp(f1, f2)
+ _cache[f1, f2] = s1, s2, outcome
return outcome
def _sig(st):
« no previous file with comments | « Lib/email/utils.py ('k') | Lib/ftplib.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+