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
f1c7c884
Kaydet (Commit)
f1c7c884
authored
Ara 13, 2000
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Typo repair in comments. Fell for GregS's .popitem() poke.
üst
24d6da3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
dictobject.c
Objects/dictobject.c
+6
-2
No files found.
Objects/dictobject.c
Dosyayı görüntüle @
f1c7c884
...
@@ -65,12 +65,16 @@ There are three kinds of slots in the table:
...
@@ -65,12 +65,16 @@ There are three kinds of slots in the table:
Holds an active (key, value) pair. Active can transition to Dummy upon
Holds an active (key, value) pair. Active can transition to Dummy upon
key deletion. This is the only case in which me_value != NULL.
key deletion. This is the only case in which me_value != NULL.
3. Dummy. me_key == dummy
&&
me_value == NULL
3. Dummy. me_key == dummy
and
me_value == NULL
Previously held an active (key, value) pair, but that was deleted and an
Previously held an active (key, value) pair, but that was deleted and an
active pair has not yet overwritten the slot. Dummy can transition to
active pair has not yet overwritten the slot. Dummy can transition to
Active upon key insertion. Dummy slots cannot be made Unused again
Active upon key insertion. Dummy slots cannot be made Unused again
(cannot have me_key set to NULL), else the probe sequence in case of
(cannot have me_key set to NULL), else the probe sequence in case of
collision would have no way to know they were once active.
collision would have no way to know they were once active.
Note: .popitem() abuses the me_hash field of an Unused or Dummy slot to
hold a search finger. The me_hash field of Unused or Dummy slots has no
meaning otherwise.
*/
*/
typedef
struct
{
typedef
struct
{
long
me_hash
;
/* cached hash code of me_key */
long
me_hash
;
/* cached hash code of me_key */
...
@@ -82,7 +86,7 @@ typedef struct {
...
@@ -82,7 +86,7 @@ typedef struct {
}
dictentry
;
}
dictentry
;
/*
/*
To ensure the lookup algorithm terminates, there must be at least one Un
s
used
To ensure the lookup algorithm terminates, there must be at least one Unused
slot (NULL key) in the table.
slot (NULL key) in the table.
The value ma_fill is the number of non-NULL keys (sum of Active and Dummy);
The value ma_fill is the number of non-NULL keys (sum of Active and Dummy);
ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL
ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL
...
...
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