optimize extpoll fd delete 94/2894/1
authorEdwin van der Oetelaar <oetelaar.automatisering@gmail.com>
Tue, 15 Jan 2013 03:23:05 +0000 (11:23 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:24 +0000 (13:01 -0800)
commitb03492ac859ff68e4de77736098fad9cedf901af
tree1d1b6985e063f337ebee81874d2ef4c39325276d
parent62ba08ecaaf698b3d501679f5feb9964cbe2b9ba
optimize extpoll fd delete

Previous method of shifting back array by one to cover the deleted
item could be expensive when the list was large and the deleted item
appeared early in it.

This scheme swaps the last guy into the vacant space and reduces the
list size by one.

(AG adapted for style and not to care if n is end guy)

Signed-off-by: Edwin van der Oetelaar <oetelaar.automatisering@gmail.com>
Signed-off-by: Andy Green <andy.green@linaro.org>
test-server/test-server-extpoll.c