Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102788486
D39691.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
345 B
Referenced Files
None
Subscribers
None
D39691.diff
View Options
diff --git a/lib/libc/stdlib/qsort.c b/lib/libc/stdlib/qsort.c
--- a/lib/libc/stdlib/qsort.c
+++ b/lib/libc/stdlib/qsort.c
@@ -114,7 +114,8 @@
int cmp_result;
int swap_cnt;
- if (__predict_false(n == 0))
+ /* if there are less than 2 elements, then sorting is not needed */
+ if (__predict_false(n < 2))
return;
loop:
swap_cnt = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 5:21 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14671304
Default Alt Text
D39691.diff (345 B)
Attached To
Mode
D39691: libc: Sorting is not needed when there are less than two elements
Attached
Detach File
Event Timeline
Log In to Comment