diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 28405409e2d..064ca50a13d 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -176,7 +176,6 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, { const uchar *map= cs->sort_order, *end; size_t length; - int res; end= a + (length= MY_MIN(a_length, b_length)); while (a < end) @@ -184,7 +183,6 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, if (map[*a++] != map[*b++]) return ((int) map[a[-1]] - (int) map[b[-1]]); } - res= 0; if (a_length != b_length) { int swap= 1; @@ -198,15 +196,14 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, size_t a_length, a_length= b_length; a= b; swap= -1; /* swap sign of result */ - res= -res; } for (end= a + a_length-length; a < end ; a++) { if (map[*a] != map[' ']) - return (map[*a] < map[' ']) ? -swap : swap; + return (map[*a] < map[' ']) ? -swap : swap; } } - return res; + return 0; }