MXS-2302: Move hint parser into its own class
Keeping the parser state internal to a subclass makes the code more readable and allows the removal of most parameters. It also removes the need to return iterator ranges from the tokenization function thus making the Token class obsolete. Unit testing benefits from this as well as it more closely resembles usage in the wild as more of the code can be run without a live system.
This commit is contained in:
@ -167,15 +167,18 @@ HINT* hint_create_parameter(HINT* head, const char* pname, const char* value)
|
||||
*/
|
||||
void hint_free(HINT* hint)
|
||||
{
|
||||
if (hint->data)
|
||||
if (hint)
|
||||
{
|
||||
MXS_FREE(hint->data);
|
||||
if (hint->data)
|
||||
{
|
||||
MXS_FREE(hint->data);
|
||||
}
|
||||
if (hint->value)
|
||||
{
|
||||
MXS_FREE(hint->value);
|
||||
}
|
||||
MXS_FREE(hint);
|
||||
}
|
||||
if (hint->value)
|
||||
{
|
||||
MXS_FREE(hint->value);
|
||||
}
|
||||
MXS_FREE(hint);
|
||||
}
|
||||
|
||||
bool hint_exists(HINT** p_hint,
|
||||
|
||||
Reference in New Issue
Block a user