[Xcb] [PATCH libxcb 02/18] c_client.py: simplify maximum expression

Christian Linhart chris at DemoRecorder.com
Mon Oct 13 08:13:09 PDT 2014


The code is nicer and more readable this way.

Reviewed-by: Christian Linhart <chris at demorecorder.com>

On 10/12/14 20:58, Ran Benita wrote:
> Signed-off-by: Ran Benita <ran234 at gmail.com>
> ---
>  src/c_client.py | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/c_client.py b/src/c_client.py
> index 51edda7..f3405b1 100644
> --- a/src/c_client.py
> +++ b/src/c_client.py
> @@ -1122,8 +1122,7 @@ def _c_serialize(context, self):
>          if not field.type.fixed_size() or self.is_switch:
>              variable_size_fields += 1
>      # determine maxtypelen
> -    for p in params:
> -        maxtypelen = max(maxtypelen, len(p[0]) + len(p[1]))
> +    maxtypelen = max(len(p[0]) + len(p[1]) for p in params)
>  
>      # write to .c/.h
>      indent = ' '*(len(func_name)+2)



More information about the Xcb mailing list