libc: Sorting is not needed when there are less than two elements
authorHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 19 Apr 2023 10:18:56 +0000 (12:18 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 19 Apr 2023 15:17:33 +0000 (17:17 +0200)
commitecb2ce3a51e9b09a57cd42262fc798ae089c0758
tree7b75245c353b399f95d4dcb32ea6c990c3ca3a38
parent409731e7d71358cda3d23d903607614c29680038
libc: Sorting is not needed when there are less than two elements

If there are less than two elements avoid executing the first
sorting loop. No functional change intended.

Reviewed by: kib@
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential Revision: https://reviews.freebsd.org/D39691
lib/libc/stdlib/qsort.c