On 20 Apr 2017 06:10, "Alexander Barkov" <bar@mariadb.org> wrote:With the "passing by pointer" approach whenever one needs to pass
a LEX_STRING to a function accepting LEX_CSTRING, one will have to do:
void func1(const LEX_STRING *str)
{
LEX_CSTRING tmp= {str->str, str->length};
func2(&tmp);
}
The above is not a problem:- We don't have less than 5 places in the code where LEX_STRING is changed to LEX_CSTRING.- In these places one can do this with a simple cast, nothing elaborated.
we use "const Lex_cstring &str" all around C++ code.2. Instead of "const LEX_CSTRING *str"No, no, no.I do not want to use & anywhere as arguments in the code. It hides things and lends people to do errors like we had before where they declared some functions to take full structure she references in other places, which creates a mess.