]> git.baikalelectronics.ru Git - kernel.git/commit
lib/sort.c optimization
authorSubbaiah Venkata <kvsnaidu@sapnaidu.net>
Wed, 17 Oct 2007 06:27:06 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:52 +0000 (08:42 -0700)
commitff8bf61cc4664d343cdd6428253bd2bb7eed2bb2
tree9c8e89d7dd7b33908ce7925df1bf7f67cade01db
parentf61e67a2e89538ddae7178b6283d68a233963f0b
lib/sort.c optimization

Hello, I fixed and tested a small bug in lib/sort.c file, heap sort
function.

The fix avoids unnecessary swap of contents when i is 0 (saves few loads
and stores), which happens every time sort function is called.  I felt the
fix is worth bringing it to your attention given the importance and
frequent use of the sort function.

Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/sort.c