Skip to content

Commit 181fef4

Browse files
committed
remove macro from original code
1 parent f34aa87 commit 181fef4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Objects/listobject.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,8 +2002,15 @@ binarysort(MergeState *ms, const sortslice *ss, Py_ssize_t n, Py_ssize_t ok)
20022002
Caution: using memmove is much slower under MSVC 5; we're not
20032003
usually moving many slots. Years later: under Visual Studio 2022,
20042004
memmove seems just slightly slower than doing it "by hand". */
2005-
2006-
_binarysort_INSORT(L, M);
2005+
for (M = ok; M > L; --M)
2006+
a[M] = a[M - 1];
2007+
a[L] = pivot;
2008+
if (has_values) {
2009+
pivot = v[ok];
2010+
for (M = ok; M > L; --M)
2011+
v[M] = v[M - 1];
2012+
v[L] = pivot;
2013+
}
20072014
}
20082015
#endif // pick binary or regular insertion sort
20092016
return 0;

0 commit comments

Comments
 (0)