diff options
Diffstat (limited to 'benchtests/bench-strcspn.c')
-rw-r--r-- | benchtests/bench-strcspn.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/benchtests/bench-strcspn.c b/benchtests/bench-strcspn.c index 9b9f7035a9..49404e4766 100644 --- a/benchtests/bench-strcspn.c +++ b/benchtests/bench-strcspn.c @@ -1,5 +1,5 @@ /* Measure strcspn 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/>. */ #define STRPBRK_RESULT(s, pos) (pos) #define RES_TYPE size_t @@ -27,25 +27,14 @@ #include "bench-string.h" #ifndef WIDE -# define STRCSPN strcspn -# define CHAR char # define SIMPLE_STRCSPN simple_strcspn -# define STUPID_STRCSPN stupid_strcspn -# define STRLEN strlen #else -# include <wchar.h> -# define STRCSPN wcscspn -# define CHAR wchar_t # define SIMPLE_STRCSPN simple_wcscspn -# define STUPID_STRCSPN stupid_wcscspn -# define STRLEN wcslen #endif /* WIDE */ typedef size_t (*proto_t) (const CHAR *, const CHAR *); size_t SIMPLE_STRCSPN (const CHAR *, const CHAR *); -size_t STUPID_STRCSPN (const CHAR *, const CHAR *); -IMPL (STUPID_STRCSPN, 0) IMPL (SIMPLE_STRCSPN, 0) IMPL (STRCSPN, 1) @@ -62,19 +51,4 @@ SIMPLE_STRCSPN (const CHAR *s, const CHAR *rej) return s - str - 1; } -size_t -STUPID_STRCSPN (const CHAR *s, const CHAR *rej) -{ - size_t ns = STRLEN (s), nrej = STRLEN (rej); - size_t i, j; - - for (i = 0; i < ns; ++i) - for (j = 0; j < nrej; ++j) - if (s[i] == rej[j]) - return i; - return i; -} - -#undef CHAR -#undef STRLEN #include "bench-strpbrk.c" |