From a4817e1520de799ae55f27444a50be54b59b09bc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 27 Jun 2023 14:09:52 +0200 Subject: [PATCH] cleanup: String::strstr() const --- sql/sql_string.cc | 6 +++--- sql/sql_string.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 7a8aa4ef0f4..208805b91ba 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -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) { @@ -703,7 +703,7 @@ skip: 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); } @@ -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 */ -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) { diff --git a/sql/sql_string.h b/sql/sql_string.h index dbb4760ab34..d112a8842b9 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -406,10 +406,10 @@ public: } // Returns offset to substring or -1 - int strstr(const Binary_string &search, uint32 offset=0); - int strstr(const char *search, uint32 search_length, uint32 offset=0); + int strstr(const Binary_string &search, uint32 offset=0) const; + int strstr(const char *search, uint32 search_length, uint32 offset=0) const; // 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