]> git.ipfire.org Git - thirdparty/linux.git/commit
lib/sort: fix outdated comment regarding glibc qsort()
authorKuan-Wei Chiu <visitorckw@gmail.com>
Mon, 27 May 2024 20:30:09 +0000 (04:30 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 25 Jun 2024 05:25:02 +0000 (22:25 -0700)
commitf49ac9571b8f1de4dfcce941a936a4d19dd7bb8a
tree561c682f95b78cb409257ec76aa217e0bfce7490
parent85fb11a87921a017e5551835eaaf58f9da173686
lib/sort: fix outdated comment regarding glibc qsort()

The existing comment in lib/sort refers to glibc qsort() using quicksort.
However, glibc qsort() no longer uses quicksort; it now uses mergesort and
falls back to heapsort if memory allocation for mergesort fails.  This
makes the comment outdated and incorrect.

Update the comment to refer to quicksort in general rather than glibc's
implementation to provide accurate information about the comparisons and
trade-offs without implying an outdated implementation.

Link: https://lkml.kernel.org/r/20240527203011.1644280-3-visitorckw@gmail.com
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/sort.c