Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
70797194
Kaydet (Commit)
70797194
authored
Haz 25, 2011
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue 11802: filecmp cache was growing without bound.
üst
6ddefd79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
filecmp.py
Lib/filecmp.py
+6
-5
No files found.
Lib/filecmp.py
Dosyayı görüntüle @
70797194
...
@@ -48,11 +48,12 @@ def cmp(f1, f2, shallow=True):
...
@@ -48,11 +48,12 @@ def cmp(f1, f2, shallow=True):
if
s1
[
1
]
!=
s2
[
1
]:
if
s1
[
1
]
!=
s2
[
1
]:
return
False
return
False
result
=
_cache
.
get
((
f1
,
f2
))
outcome
=
_cache
.
get
((
f1
,
f2
,
s1
,
s2
))
if
result
and
(
s1
,
s2
)
==
result
[:
2
]:
if
outcome
is
None
:
return
result
[
2
]
outcome
=
_do_cmp
(
f1
,
f2
)
outcome
=
_do_cmp
(
f1
,
f2
)
if
len
(
_cache
)
>
100
:
# limit the maximum size of the cache
_cache
[
f1
,
f2
]
=
s1
,
s2
,
outcome
_cache
.
clear
()
_cache
[
f1
,
f2
,
s1
,
s2
]
=
outcome
return
outcome
return
outcome
def
_sig
(
st
):
def
_sig
(
st
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment