From 80fbd0ee94a507009cc679ba3534d9d10313678c Mon Sep 17 00:00:00 2001 From: NTH19 <74389817+NTH19@users.noreply.github.com> Date: Sat, 27 Aug 2022 17:19:16 +0800 Subject: [PATCH] Remove redundant variable (#2237) --- strings/ctype-simple.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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; }