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
88057171
Kaydet (Commit)
88057171
authored
Eyl 12, 2016
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert part of 3471a3515827 that caused a performance regression
üst
4103e4df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
8 deletions
+44
-8
_collectionsmodule.c
Modules/_collectionsmodule.c
+44
-8
No files found.
Modules/_collectionsmodule.c
Dosyayı görüntüle @
88057171
...
...
@@ -403,10 +403,28 @@ deque_extend(dequeobject *deque, PyObject *iterable)
iternext
=
*
Py_TYPE
(
it
)
->
tp_iternext
;
while
((
item
=
iternext
(
it
))
!=
NULL
)
{
if
(
deque_append_internal
(
deque
,
item
,
maxlen
)
<
0
)
{
Py_DECREF
(
item
);
Py_DECREF
(
it
);
return
NULL
;
if
(
deque
->
rightindex
==
BLOCKLEN
-
1
)
{
block
*
b
=
newblock
();
if
(
b
==
NULL
)
{
Py_DECREF
(
item
);
Py_DECREF
(
it
);
return
NULL
;
}
b
->
leftlink
=
deque
->
rightblock
;
CHECK_END
(
deque
->
rightblock
->
rightlink
);
deque
->
rightblock
->
rightlink
=
b
;
deque
->
rightblock
=
b
;
MARK_END
(
b
->
rightlink
);
deque
->
rightindex
=
-
1
;
}
Py_SIZE
(
deque
)
++
;
deque
->
rightindex
++
;
deque
->
rightblock
->
data
[
deque
->
rightindex
]
=
item
;
if
(
NEEDS_TRIM
(
deque
,
maxlen
))
{
PyObject
*
olditem
=
deque_popleft
(
deque
,
NULL
);
Py_DECREF
(
olditem
);
}
else
{
deque
->
state
++
;
}
}
return
finalize_iterator
(
it
);
...
...
@@ -450,10 +468,28 @@ deque_extendleft(dequeobject *deque, PyObject *iterable)
iternext
=
*
Py_TYPE
(
it
)
->
tp_iternext
;
while
((
item
=
iternext
(
it
))
!=
NULL
)
{
if
(
deque_appendleft_internal
(
deque
,
item
,
maxlen
)
<
0
)
{
Py_DECREF
(
item
);
Py_DECREF
(
it
);
return
NULL
;
if
(
deque
->
leftindex
==
0
)
{
block
*
b
=
newblock
();
if
(
b
==
NULL
)
{
Py_DECREF
(
item
);
Py_DECREF
(
it
);
return
NULL
;
}
b
->
rightlink
=
deque
->
leftblock
;
CHECK_END
(
deque
->
leftblock
->
leftlink
);
deque
->
leftblock
->
leftlink
=
b
;
deque
->
leftblock
=
b
;
MARK_END
(
b
->
leftlink
);
deque
->
leftindex
=
BLOCKLEN
;
}
Py_SIZE
(
deque
)
++
;
deque
->
leftindex
--
;
deque
->
leftblock
->
data
[
deque
->
leftindex
]
=
item
;
if
(
NEEDS_TRIM
(
deque
,
maxlen
))
{
PyObject
*
olditem
=
deque_pop
(
deque
,
NULL
);
Py_DECREF
(
olditem
);
}
else
{
deque
->
state
++
;
}
}
return
finalize_iterator
(
it
);
...
...
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