]> granicus.if.org Git - python/commit
More sort cleanup: Moved the special cases from samplesortslice into
authorTim Peters <tim.peters@gmail.com>
Fri, 19 Jul 2002 07:05:44 +0000 (07:05 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 19 Jul 2002 07:05:44 +0000 (07:05 +0000)
commit330f9e9581a5d97a0560f10182ae882b07eb3c66
tree91f26b00dd4376e7734673e561b82443dd11442e
parent8235ea1c3a5c57c9279668b5bff3d5f021ceb2d5
More sort cleanup:  Moved the special cases from samplesortslice into
listsort.  If the former calls itself recursively, they're a waste of
time, since it's called on a random permutation of a random subset of
elements.  OTOH, for exactly the same reason, they're an immeasurably
small waste of time (the odds of finding exploitable order in a random
permutation are ~= 0, so the special-case loops looking for order give
up quickly).  The point is more for conceptual clarity.
Also changed some "assert comments" into real asserts; when this code
was first written, Python.h didn't supply assert.h.
Objects/listobject.c