Skip to content

Commit a4817e1

Browse files
committed
cleanup: String::strstr() const
1 parent f6e488c commit a4817e1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sql/sql_string.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
677677
}
678678

679679

680-
int Binary_string::strstr(const char *search, uint32 search_length, uint32 offset)
680+
int Binary_string::strstr(const char *search, uint32 search_length, uint32 offset) const
681681
{
682682
if (search_length + offset <= str_length)
683683
{
@@ -703,7 +703,7 @@ int Binary_string::strstr(const char *search, uint32 search_length, uint32 offse
703703
return -1;
704704
}
705705

706-
int Binary_string::strstr(const Binary_string &s, uint32 offset)
706+
int Binary_string::strstr(const Binary_string &s, uint32 offset) const
707707
{
708708
return strstr(s.ptr(), s.length(), offset);
709709
}
@@ -712,7 +712,7 @@ int Binary_string::strstr(const Binary_string &s, uint32 offset)
712712
** Search string from end. Offset is offset to the end of string
713713
*/
714714

715-
int Binary_string::strrstr(const Binary_string &s, uint32 offset)
715+
int Binary_string::strrstr(const Binary_string &s, uint32 offset) const
716716
{
717717
if (s.length() <= offset && offset <= str_length)
718718
{

sql/sql_string.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,10 @@ class Binary_string: public Sql_alloc
406406
}
407407

408408
// Returns offset to substring or -1
409-
int strstr(const Binary_string &search, uint32 offset=0);
410-
int strstr(const char *search, uint32 search_length, uint32 offset=0);
409+
int strstr(const Binary_string &search, uint32 offset=0) const;
410+
int strstr(const char *search, uint32 search_length, uint32 offset=0) const;
411411
// Returns offset to substring or -1
412-
int strrstr(const Binary_string &search, uint32 offset=0);
412+
int strrstr(const Binary_string &search, uint32 offset=0) const;
413413

414414
/*
415415
The following append operations do not extend the strings and in production

0 commit comments

Comments
 (0)