[tarantool-patches] [PATCH] Refactoring in string validation of log parametrs

Vladimir Davydov vdavydov.dev at gmail.com
Tue Jul 10 14:44:53 MSK 2018


On Tue, Jul 10, 2018 at 11:10:05AM +0300, Olga Arkhangelskaia wrote:
> Log type check happens twise. This patch deletes
> unnecessary check
> 
> Signed-off-by: Olga Arkhangelskaia <arkholga at tarantool.org>
> ---
>  src/box/box.cc | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/src/box/box.cc b/src/box/box.cc
> index 033829a7f..464018f35 100644
> --- a/src/box/box.cc
> +++ b/src/box/box.cc
> @@ -342,11 +342,6 @@ box_check_say()
>  			  diag_last_error(diag_get())->errmsg);
>  	}
>  
> -	if (say_check_init_str(log) == -1) {
> -
> -		diag_raise();
> -	}
> -

The check is done twice indeed, which is obviously pointless. However,
I think that instead of removing the call to say_check_init_str(), we'd
better move the whole check to say.c for the sake of encapsulation, i.e.

 - rename say_check_init_str to say_check_cfg
 - pass values of 'log', 'log_format', and 'log_nonblock' to it
 - move all checks from box_check_say to say_check_cfg; after this patch
   box_check_say should only retrieve configuration options and pass
   them to say_check_cfg



More information about the Tarantool-patches mailing list