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
e32907df
Kaydet (Commit)
e32907df
authored
Nis 28, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Get rid of the unused ifdefed-out old sort code.
üst
2ea1c94b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
76 deletions
+0
-76
listobject.c
Objects/listobject.c
+0
-76
No files found.
Objects/listobject.c
Dosyayı görüntüle @
e32907df
...
...
@@ -573,10 +573,6 @@ listappend(self, args)
return
ins
(
self
,
(
int
)
self
->
ob_size
,
v
);
}
#define NEWSORT
#ifdef NEWSORT
/* New quicksort implementation for arrays of object pointers.
Thanks to discussions with Tim Peters. */
...
...
@@ -828,78 +824,6 @@ listsort(self, compare)
return
Py_None
;
}
#else
/* !NEWSORT */
static
PyObject
*
comparefunc
;
static
int
cmp
(
v
,
w
)
const
ANY
*
v
,
*
w
;
{
PyObject
*
t
,
*
res
;
long
i
;
if
(
PyErr_Occurred
())
return
0
;
if
(
comparefunc
==
NULL
)
return
PyObject_Compare
(
*
(
PyObject
**
)
v
,
*
(
PyObject
**
)
w
);
/* Call the user-supplied comparison function */
t
=
Py_BuildValue
(
"(OO)"
,
*
(
PyObject
**
)
v
,
*
(
PyObject
**
)
w
);
if
(
t
==
NULL
)
return
0
;
res
=
PyEval_CallObject
(
comparefunc
,
t
);
Py_DECREF
(
t
);
if
(
res
==
NULL
)
return
0
;
if
(
!
PyInt_Check
(
res
))
{
PyErr_SetString
(
PyExc_TypeError
,
"comparison function should return int"
);
i
=
0
;
}
else
{
i
=
PyInt_AsLong
(
res
);
if
(
i
<
0
)
i
=
-
1
;
else
if
(
i
>
0
)
i
=
1
;
}
Py_DECREF
(
res
);
return
(
int
)
i
;
}
static
PyObject
*
listsort
(
self
,
args
)
PyListObject
*
self
;
PyObject
*
args
;
{
PyObject
*
save_comparefunc
;
if
(
self
->
ob_size
<=
1
)
{
Py_INCREF
(
Py_None
);
return
Py_None
;
}
save_comparefunc
=
comparefunc
;
comparefunc
=
args
;
if
(
comparefunc
!=
NULL
)
{
/* Test the comparison function for obvious errors */
(
void
)
cmp
((
ANY
*
)
&
self
->
ob_item
[
0
],
(
ANY
*
)
&
self
->
ob_item
[
1
]);
if
(
PyErr_Occurred
())
{
comparefunc
=
save_comparefunc
;
return
NULL
;
}
}
qsort
((
char
*
)
self
->
ob_item
,
(
int
)
self
->
ob_size
,
sizeof
(
PyObject
*
),
cmp
);
comparefunc
=
save_comparefunc
;
if
(
PyErr_Occurred
())
return
NULL
;
Py_INCREF
(
Py_None
);
return
Py_None
;
}
#endif
static
PyObject
*
listreverse
(
self
,
args
)
PyListObject
*
self
;
...
...
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