diff options
author | Michael Widenius <monty@mariadb.org> | 2017-06-18 14:00:28 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-08-24 01:05:53 +0200 |
commit | 25c06f5282513e15c25c54364ef886310126e870 (patch) | |
tree | 4a695cd4d445e7af0739dc4485e8fb14b3d6451f /sql/sp_pcontext.cc | |
parent | cc77f9882dcaa4e02196bb3847cd66f2943eb4c6 (diff) | |
download | mariadb-git-25c06f5282513e15c25c54364ef886310126e870.tar.gz |
Optimize LEX_STRING comparisons
- Added inline lex_string_cmp() to replace my_strcase_cmp().
- Added inline lex_string_eq to first compares lengths before comparing strings
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r-- | sql/sp_pcontext.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 87dfed2a8d3..1e2081e3479 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -132,8 +132,8 @@ sp_pcontext *sp_pcontext::push_context(THD *thd, sp_pcontext::enum_scope scope) bool cmp_labels(sp_label *a, sp_label *b) { - return (my_strcasecmp(system_charset_info, a->name.str, b->name.str) == 0 - && a->type == b->type); + return (lex_string_cmp(system_charset_info, &a->name, &b->name) == 0 && + a->type == b->type); } sp_pcontext *sp_pcontext::pop_context() @@ -304,7 +304,7 @@ sp_label *sp_pcontext::find_goto_label(const LEX_CSTRING *name, bool recusive) while ((lab= li++)) { - if (my_strcasecmp(system_charset_info, name->str, lab->name.str) == 0) + if (lex_string_cmp(system_charset_info, name, &lab->name) == 0) return lab; } @@ -341,7 +341,7 @@ sp_label *sp_pcontext::find_label(const LEX_CSTRING *name) while ((lab= li++)) { - if (my_strcasecmp(system_charset_info, name->str, lab->name.str) == 0) + if (lex_string_cmp(system_charset_info, name, &lab->name) == 0) return lab; } |