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
6dab0523
Kaydet (Commit)
6dab0523
authored
Kas 15, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Change ValueErrors to TypeErrors and add PyList_Check() assertions.
üst
236a2443
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
heapqmodule.c
Modules/heapqmodule.c
+6
-4
No files found.
Modules/heapqmodule.c
Dosyayı görüntüle @
6dab0523
...
@@ -14,6 +14,7 @@ _siftdown(PyListObject *heap, int startpos, int pos)
...
@@ -14,6 +14,7 @@ _siftdown(PyListObject *heap, int startpos, int pos)
PyObject
*
newitem
,
*
parent
;
PyObject
*
newitem
,
*
parent
;
int
cmp
,
parentpos
;
int
cmp
,
parentpos
;
assert
(
PyList_Check
(
heap
));
if
(
pos
>=
PyList_GET_SIZE
(
heap
))
{
if
(
pos
>=
PyList_GET_SIZE
(
heap
))
{
PyErr_SetString
(
PyExc_IndexError
,
"index out of range"
);
PyErr_SetString
(
PyExc_IndexError
,
"index out of range"
);
return
-
1
;
return
-
1
;
...
@@ -48,6 +49,7 @@ _siftup(PyListObject *heap, int pos)
...
@@ -48,6 +49,7 @@ _siftup(PyListObject *heap, int pos)
int
cmp
;
int
cmp
;
PyObject
*
newitem
,
*
tmp
;
PyObject
*
newitem
,
*
tmp
;
assert
(
PyList_Check
(
heap
));
endpos
=
PyList_GET_SIZE
(
heap
);
endpos
=
PyList_GET_SIZE
(
heap
);
startpos
=
pos
;
startpos
=
pos
;
if
(
pos
>=
endpos
)
{
if
(
pos
>=
endpos
)
{
...
@@ -97,7 +99,7 @@ heappush(PyObject *self, PyObject *args)
...
@@ -97,7 +99,7 @@ heappush(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
if
(
!
PyList_Check
(
heap
))
{
if
(
!
PyList_Check
(
heap
))
{
PyErr_SetString
(
PyExc_
Valu
eError
,
"heap argument must be a list"
);
PyErr_SetString
(
PyExc_
Typ
eError
,
"heap argument must be a list"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -120,7 +122,7 @@ heappop(PyObject *self, PyObject *heap)
...
@@ -120,7 +122,7 @@ heappop(PyObject *self, PyObject *heap)
int
n
;
int
n
;
if
(
!
PyList_Check
(
heap
))
{
if
(
!
PyList_Check
(
heap
))
{
PyErr_SetString
(
PyExc_
Valu
eError
,
"heap argument must be a list"
);
PyErr_SetString
(
PyExc_
Typ
eError
,
"heap argument must be a list"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -159,7 +161,7 @@ heapreplace(PyObject *self, PyObject *args)
...
@@ -159,7 +161,7 @@ heapreplace(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
if
(
!
PyList_Check
(
heap
))
{
if
(
!
PyList_Check
(
heap
))
{
PyErr_SetString
(
PyExc_
Valu
eError
,
"heap argument must be a list"
);
PyErr_SetString
(
PyExc_
Typ
eError
,
"heap argument must be a list"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -192,7 +194,7 @@ heapify(PyObject *self, PyObject *heap)
...
@@ -192,7 +194,7 @@ heapify(PyObject *self, PyObject *heap)
int
i
,
n
;
int
i
,
n
;
if
(
!
PyList_Check
(
heap
))
{
if
(
!
PyList_Check
(
heap
))
{
PyErr_SetString
(
PyExc_
Valu
eError
,
"heap argument must be a list"
);
PyErr_SetString
(
PyExc_
Typ
eError
,
"heap argument must be a list"
);
return
NULL
;
return
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