From 34a840a62f68a23be6b16fae7687a1a66a94ddd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Filip=20Ros=C3=A9en?= Date: Thu, 18 May 2017 12:01:56 +0200 Subject: [PATCH] keystore/kwallet: values2key: simplify if-condition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There is no need to check for the inverse of a condition that was just being checked. Signed-off-by: RĂ©mi Denis-Courmont --- modules/keystore/kwallet.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/keystore/kwallet.c b/modules/keystore/kwallet.c index e9a96bb994..068970db3b 100644 --- a/modules/keystore/kwallet.c +++ b/modules/keystore/kwallet.c @@ -149,10 +149,13 @@ values2key( const char* const* ppsz_values, bool b_search ) vlc_memstream_printf( &ms, "*" ); /* Path section */ - if ( ppsz_values[KEY_PATH] && ppsz_values[KEY_PATH][0] == '/') - vlc_memstream_printf( &ms, "%s", ppsz_values[KEY_PATH] ); - else if ( ppsz_values[KEY_PATH] && ppsz_values[KEY_PATH][0] != '/' ) - vlc_memstream_printf( &ms, "/%s", ppsz_values[KEY_PATH] ); + if( ppsz_values[KEY_PATH] ) + { + if( ppsz_values[KEY_PATH][0] != '/' ) + vlc_memstream_putc( &ms, '/' ); + + vlc_memstream_puts( &ms, ppsz_values[KEY_PATH] ); + } else if ( b_search ) vlc_memstream_printf( &ms, "*" ); -- 2.11.4.GIT