Commit a4817e15 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: String::strstr() const

parent f6e488cc
...@@ -677,7 +677,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length, ...@@ -677,7 +677,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
} }
int Binary_string::strstr(const char *search, uint32 search_length, uint32 offset) int Binary_string::strstr(const char *search, uint32 search_length, uint32 offset) const
{ {
if (search_length + offset <= str_length) if (search_length + offset <= str_length)
{ {
...@@ -703,7 +703,7 @@ int Binary_string::strstr(const char *search, uint32 search_length, uint32 offse ...@@ -703,7 +703,7 @@ int Binary_string::strstr(const char *search, uint32 search_length, uint32 offse
return -1; return -1;
} }
int Binary_string::strstr(const Binary_string &s, uint32 offset) int Binary_string::strstr(const Binary_string &s, uint32 offset) const
{ {
return strstr(s.ptr(), s.length(), offset); return strstr(s.ptr(), s.length(), offset);
} }
...@@ -712,7 +712,7 @@ int Binary_string::strstr(const Binary_string &s, uint32 offset) ...@@ -712,7 +712,7 @@ int Binary_string::strstr(const Binary_string &s, uint32 offset)
** Search string from end. Offset is offset to the end of string ** Search string from end. Offset is offset to the end of string
*/ */
int Binary_string::strrstr(const Binary_string &s, uint32 offset) int Binary_string::strrstr(const Binary_string &s, uint32 offset) const
{ {
if (s.length() <= offset && offset <= str_length) if (s.length() <= offset && offset <= str_length)
{ {
......
...@@ -406,10 +406,10 @@ class Binary_string: public Sql_alloc ...@@ -406,10 +406,10 @@ class Binary_string: public Sql_alloc
} }
// Returns offset to substring or -1 // Returns offset to substring or -1
int strstr(const Binary_string &search, uint32 offset=0); int strstr(const Binary_string &search, uint32 offset=0) const;
int strstr(const char *search, uint32 search_length, uint32 offset=0); int strstr(const char *search, uint32 search_length, uint32 offset=0) const;
// Returns offset to substring or -1 // Returns offset to substring or -1
int strrstr(const Binary_string &search, uint32 offset=0); int strrstr(const Binary_string &search, uint32 offset=0) const;
/* /*
The following append operations do not extend the strings and in production The following append operations do not extend the strings and in production
......
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