diff options
Diffstat (limited to 'benchtests/bench-strncasecmp.c')
-rw-r--r-- | benchtests/bench-strncasecmp.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/benchtests/bench-strncasecmp.c b/benchtests/bench-strncasecmp.c index 37eb082323..c2db4270eb 100644 --- a/benchtests/bench-strncasecmp.c +++ b/benchtests/bench-strncasecmp.c @@ -1,5 +1,5 @@ /* Measure strncasecmp functions. - Copyright (C) 2013-2018 Free Software Foundation, Inc. + Copyright (C) 2013-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <ctype.h> #define TEST_MAIN @@ -23,9 +23,7 @@ typedef int (*proto_t) (const char *, const char *, size_t); static int simple_strncasecmp (const char *, const char *, size_t); -static int stupid_strncasecmp (const char *, const char *, size_t); -IMPL (stupid_strncasecmp, 0) IMPL (simple_strncasecmp, 0) IMPL (strncasecmp, 1) @@ -48,27 +46,6 @@ simple_strncasecmp (const char *s1, const char *s2, size_t n) return ret; } -static int -stupid_strncasecmp (const char *s1, const char *s2, size_t max) -{ - size_t ns1 = strlen (s1) + 1; - size_t ns2 = strlen (s2) + 1; - size_t n = ns1 < ns2 ? ns1 : ns2; - if (n > max) - n = max; - int ret = 0; - - while (n--) - { - if ((ret = ((unsigned char) tolower (*s1) - - (unsigned char) tolower (*s2))) != 0) - break; - ++s1; - ++s2; - } - return ret; -} - static void do_one_test (impl_t *impl, const char *s1, const char *s2, size_t n, int exp_result) |