Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0a48146e
Commit
0a48146e
authored
Oct 22, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client/Client: pass std::string_view to Write()
Almost all callers have string literal, and the length is known at compile time.
parent
0c4bf12b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
7 deletions
+3
-7
Client.hxx
src/client/Client.hxx
+3
-1
Write.cxx
src/client/Write.cxx
+0
-6
No files found.
src/client/Client.hxx
View file @
0a48146e
...
...
@@ -150,7 +150,9 @@ public:
/**
* Write a null-terminated string.
*/
bool
Write
(
const
char
*
data
)
noexcept
;
bool
Write
(
std
::
string_view
s
)
noexcept
{
return
Write
(
s
.
data
(),
s
.
size
());
}
/**
* returns the uid of the client process, or a negative value
...
...
src/client/Write.cxx
View file @
0a48146e
...
...
@@ -27,9 +27,3 @@ Client::Write(const void *data, size_t length) noexcept
/* if the client is going to be closed, do nothing */
return
!
IsExpired
()
&&
FullyBufferedSocket
::
Write
(
data
,
length
);
}
bool
Client
::
Write
(
const
char
*
data
)
noexcept
{
return
Write
(
data
,
strlen
(
data
));
}
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