[PATCH weston 3/3] xwm: Test hash_table_lookup() returns

Bill Spitzak spitzak at gmail.com
Tue Apr 7 11:34:51 PDT 2015


Oh ok I see you put this in a different patch. I think the patches 
should be merged since you have to change all the calls in the first 
patch anyway.

I don't like the temporary variable, it seems like you can just put the 
call to hash_table_lookup in the if statement and it will be clearer.

On 04/07/2015 10:12 AM, Derek Foreman wrote:

> +	int found;
>
> -	hash_table_lookup(wm->window_hash, leave->event, &window);
> -	if (!window || !window->decorate)
> +	found = hash_table_lookup(wm->window_hash, leave->event, &window);
> +	if (!found || !window->decorate)
>   		return;

ie:

	if (!hash_table_lookup(wm->window_hash, leave->event, &window))
	  return;
	if (!window->decorate)
	  return;


More information about the wayland-devel mailing list