Commit 7c9dba22 authored by unknown's avatar unknown

InnoDB: Remove ut_str_contains() and replace it with strchr()


innobase/dict/dict0dict.c:
  Replace ut_str_contains() with strchr()
innobase/include/ut0mem.h:
  Remove ut_str_contains(), a reinvented strchr()
innobase/row/row0mysql.c:
  Replace ut_str_contains() with strchr()
innobase/ut/ut0mem.c:
  Remove ut_str_contains(), a reinvented strchr()
parent 19b727ad
......@@ -1002,7 +1002,7 @@ dict_table_rename_in_cache(
sprintf(foreign->foreign_table_name, "%s", table->name);
if (ut_str_contains(foreign->id, '/')) {
if (strchr(foreign->id, '/')) {
ulint db_len;
char old_id[2000];
......@@ -3331,7 +3331,7 @@ loop:
while (foreign != NULL) {
if (0 == ut_strcmp(foreign->id, id)
|| (ut_str_contains(foreign->id, '/')
|| (strchr(foreign->id, '/')
&& 0 == ut_strcmp(id,
dict_remove_db_name(foreign->id)))) {
/* Found */
......@@ -4059,7 +4059,7 @@ dict_print_info_on_foreign_key_in_create_format(
ulint cpy_len;
ulint i;
if (ut_str_contains(foreign->id, '/')) {
if (strchr(foreign->id, '/')) {
/* Strip the preceding database name from the constraint id */
stripped_id = foreign->id + 1
+ dict_get_db_name_len(foreign->id);
......
......@@ -85,14 +85,6 @@ ut_str_catenate(
/* out, own: catenated null-terminated string */
char* str1, /* in: null-terminated string */
char* str2); /* in: null-terminated string */
/**************************************************************************
Checks if a null-terminated string contains a certain character. */
ibool
ut_str_contains(
/*============*/
char* str, /* in: null-terminated string */
char c); /* in: character */
#ifndef UNIV_NONINL
#include "ut0mem.ic"
......
......@@ -2362,7 +2362,7 @@ row_rename_table_for_mysql(
db_name, constraints_to_drop[i],
db_name, constraints_to_drop[i]);
if (!ut_str_contains(constraints_to_drop[i], '/')) {
if (!strchr(constraints_to_drop[i], '/')) {
/* If this happens to be an old format
constraint, let us delete it. Since all new
format constraints contain '/', it does no
......
......@@ -221,27 +221,3 @@ ut_str_catenate(
return(str);
}
/**************************************************************************
Checks if a null-terminated string contains a certain character. */
ibool
ut_str_contains(
/*============*/
char* str, /* in: null-terminated string */
char c) /* in: character */
{
ulint len;
ulint i;
len = ut_strlen(str);
for (i = 0; i < len; i++) {
if (str[i] == c) {
return(TRUE);
}
}
return(FALSE);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment