From e09299511e83f11f7476f7ea6c81ee12b00d7050 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 16 Mar 2016 10:55:12 +0400 Subject: MDEV-9665 Remove cs->cset->ismbchar() Using a more powerfull cs->cset->charlen() instead. --- strings/ctype-big5.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'strings/ctype-big5.c') diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index d6a9695afbf..3351fb6ef2f 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -862,12 +862,12 @@ my_strnxfrm_big5(CHARSET_INFO *cs, for (; dst < de && src < se && nweights; nweights--) { - if (cs->cset->ismbchar(cs, (const char*) src, (const char*) se)) + if (my_charlen(cs, src, se) > 1) { /* Note, it is safe not to check (src < se) - in the code below, because ismbchar() would - not return TRUE if src was too short + in the code below, because my_charlen() would + not return 2 if src was too short */ uint16 e= big5strokexfrm((uint16) big5code(*src, *(src + 1))); *dst++= big5head(e); @@ -930,13 +930,6 @@ static int my_strxfrm_big5(uchar *dest, const uchar *src, int len) #endif -static uint ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)), - const char* p, const char *e) -{ - return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0); -} - - static uint mbcharlen_big5(CHARSET_INFO *cs __attribute__((unused)), uint c) { return (isbig5head(c)? 2 : 1); @@ -6818,7 +6811,6 @@ static MY_COLLATION_HANDLER my_collation_handler_big5_bin= static MY_CHARSET_HANDLER my_charset_big5_handler= { NULL, /* init */ - ismbchar_big5, mbcharlen_big5, my_numchars_mb, my_charpos_mb, -- cgit v1.2.1