[PATCH 01/11] dix: Refactor block and wakup handlers

Daniel Stone daniel at fooishbar.org
Mon Jan 3 13:22:04 PST 2011


Hi,

On Fri, Dec 31, 2010 at 07:30:59PM +0200, Pauli wrote:
> -    if (handlerDeleted)
> +    if (block.deleted)
>      {
> -	for (i = 0; i < numHandlers;)
> -	    if (handlers[i].deleted)
> -	    {
> -	    	for (j = i; j < numHandlers - 1; j++)
> -		    handlers[j] = handlers[j+1];
> -	    	numHandlers--;
> -	    }
> -	    else
> -		i++;
> -	handlerDeleted = FALSE;
> +	for (i = 0; !block.deleted[i]; i++) {
> +	}
> +
> +	for (j = i + 1; j < block.num; j++) {
> +	    if (block.deleted[j])
> +		continue;
> +	    block.handlers[i] = block.handlers[j];
> +	    i++;
> +	}
> +	block.num -= j - i;

block.num = i + 1 would be a fair bit clearer here.  But aside from
that, nice!

For the series:
Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110103/1727fbac/attachment.pgp>


More information about the xorg-devel mailing list