Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a4817e15
Commit
a4817e15
authored
Jun 27, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: String::strstr() const
parent
f6e488cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
sql/sql_string.cc
sql/sql_string.cc
+3
-3
sql/sql_string.h
sql/sql_string.h
+3
-3
No files found.
sql/sql_string.cc
View file @
a4817e15
...
...
@@ -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 @@ int Binary_string::strstr(const char *search, uint32 search_length, uint32 offse
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
)
{
...
...
sql/sql_string.h
View file @
a4817e15
...
...
@@ -406,10 +406,10 @@ class Binary_string: public Sql_alloc
}
// 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment