Re: [systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-16 Thread Yang Chengwei
> > Sorry, still not getting what you want to say. > > Mayb ethere is some confusion regarding what .idx actually is? .idx is Yes, it proved that I was wrong, that patch is right only and only when both items' idx is NULL, this apparently not the case. Please ignore that patch, thanks for your

Re: [systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-16 Thread Lennart Poettering
On Mon, 16.12.13 13:15, Yang Chengwei (chengwei.y...@intel.com) wrote: > On Mon, Dec 16, 2013 at 04:57:39AM +0100, Lennart Poettering wrote: > > On Mon, 16.12.13 04:48, Lennart Poettering (lenn...@poettering.net) wrote: > > > > > > > > On Mon, 16.12.13 11:03, Chengwei Yang (chengwei.y...@intel.c

Re: [systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-15 Thread Yang Chengwei
On Mon, Dec 16, 2013 at 04:57:39AM +0100, Lennart Poettering wrote: > On Mon, 16.12.13 04:48, Lennart Poettering (lenn...@poettering.net) wrote: > > > > > On Mon, 16.12.13 11:03, Chengwei Yang (chengwei.y...@intel.com) wrote: > > > > > the swap() operation of prioq which in fact only swap item's

Re: [systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-15 Thread Lennart Poettering
On Mon, 16.12.13 04:48, Lennart Poettering (lenn...@poettering.net) wrote: > > On Mon, 16.12.13 11:03, Chengwei Yang (chengwei.y...@intel.com) wrote: > > > the swap() operation of prioq which in fact only swap item's data but > > keep idx untouched. However, current implement does first swap the

Re: [systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-15 Thread Lennart Poettering
On Mon, 16.12.13 11:03, Chengwei Yang (chengwei.y...@intel.com) wrote: > the swap() operation of prioq which in fact only swap item's data but > keep idx untouched. However, current implement does first swap the idx > and then swap back again. Sorry, I do understand? Can you elaborate, please? Is

[systemd-devel] [PATCH] prioq: avoid to swap item index

2013-12-15 Thread Chengwei Yang
the swap() operation of prioq which in fact only swap item's data but keep idx untouched. However, current implement does first swap the idx and then swap back again. --- src/shared/prioq.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/shared/prioq.c b/src/shared/prioq.c ind