login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
September
»
25
Re: [PATCH] lib/sort.c, 2.6.22 kernel
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Jan Engelhardt <jengelh@...>
To: Subbaiah Venkata <kvsnaidu@...>
Cc: <linux-kernel@...>
Subject:
Re: [PATCH] lib/sort.c, 2.6.22 kernel
Date: Tuesday, September 25, 2007 - 10:52 am
On Aug 8 2007 16:19, Subbaiah Venkata wrote:
quoted text
> >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.
Would you like to resubmit this? Please do ;) (I am hinting at Documentation/SubmittingPatches too..)
quoted text
>================================================================== >diff --git a/lib/sort.c b/lib/sort.c >index 9615678..6abbaf3 100644 >--- a/lib/sort.c >+++ b/lib/sort.c >@@ -67,7 +67,7 @@ void sort(void *base, size_t num, size_t size, > } > > /* sort */ >- for (i = n - size; i >= 0; i -= size) { >+ for (i = n - size; i > 0; i -= size) { > swap(base, base + i, size); > for (r = 0; r * 2 + size < i; r = c) { > c = r * 2 + size; >
-
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] lib/sort.c, 2.6.22 kernel
, Subbaiah Venkata
, (Wed Aug 8, 7:19 pm)
Re: [PATCH] lib/sort.c, 2.6.22 kernel
, Jan Engelhardt
, (Tue Sep 25, 10:52 am)
Re: [PATCH] lib/sort.c, 2.6.22 kernel
, Matt Mackall
, (Tue Sep 25, 1:37 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Benjamin Herrenschmidt
Re: [PATCH] Remove process freezer from suspend to RAM pathway
Greg KH
[GIT PATCH] driver core patches against 2.6.24
Mariusz Kozlowski
[PATCH 03] drivers/sbus/char/bbc_envctrl.c: kmalloc + memset conversion to kzalloc
Yinghai Lu
[PATCH 02/16] x86: introduce nr_irqs for 64bit v3
git
:
linux-netdev
:
Gerrit Renker
[PATCH 13/37] dccp: Deprecate Ack Ratio sysctl
James Morris
Re: [GIT]: Networking
Jeff Garzik
Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin"
git-commits-head
:
Colocation donated by:
Who's online
There are currently
1 user
and
1147 guests
online.
Online users
strcmp
Syndicate