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
94cb1545
Commit
94cb1545
authored
Jan 21, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp: use vector::front() instead of [0]
parent
411527a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
UpnpDatabasePlugin.cxx
src/db/UpnpDatabasePlugin.cxx
+5
-5
No files found.
src/db/UpnpDatabasePlugin.cxx
View file @
94cb1545
...
...
@@ -226,12 +226,12 @@ UpnpDatabase::GetSong(const char *uri, Error &error) const
}
ContentDirectoryService
server
;
if
(
!
m_superdir
->
getServer
(
vpath
[
0
]
.
c_str
(),
server
,
error
))
if
(
!
m_superdir
->
getServer
(
vpath
.
front
()
.
c_str
(),
server
,
error
))
return
nullptr
;
vpath
.
erase
(
vpath
.
begin
());
UPnPDirObject
dirent
;
if
(
vpath
[
0
].
compare
(
rootid
)
)
{
if
(
vpath
.
front
()
!=
rootid
)
{
std
::
string
objid
;
if
(
!
Namei
(
server
,
vpath
,
objid
,
dirent
,
error
))
return
nullptr
;
...
...
@@ -433,7 +433,7 @@ UpnpDatabase::ReadNode(ContentDirectoryService &server,
return
false
;
if
(
dirbuf
.
objects
.
size
()
==
1
)
{
dirent
=
std
::
move
(
dirbuf
.
objects
[
0
]
);
dirent
=
std
::
move
(
dirbuf
.
objects
.
front
()
);
}
else
{
error
.
Format
(
upnp_domain
,
"Bad resource"
);
return
false
;
...
...
@@ -547,7 +547,7 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server,
/* !Note: this *can't* be handled by Namei further down,
because the path is not valid for traversal. Besides, it's
just faster to access the target node directly */
if
(
!
vpath
.
empty
()
&&
!
vpath
[
0
].
compare
(
rootid
)
)
{
if
(
!
vpath
.
empty
()
&&
vpath
.
front
()
==
rootid
)
{
if
(
visit_song
)
{
UPnPDirObject
dirent
;
if
(
!
ReadNode
(
server
,
vpath
.
back
().
c_str
(),
dirent
,
...
...
@@ -713,7 +713,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
}
// We do have a path: the first element selects the server
std
::
string
servername
(
vpath
[
0
]
);
std
::
string
servername
(
vpath
.
front
()
);
vpath
.
erase
(
vpath
.
begin
());
ContentDirectoryService
server
;
...
...
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