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
54348561
Commit
54348561
authored
Jan 21, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/upnp: use std::list instead of std::vector
Reduce overhead.
parent
aa1eb2f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
UpnpDatabasePlugin.cxx
src/db/UpnpDatabasePlugin.cxx
+7
-6
Util.cxx
src/db/upnp/Util.cxx
+2
-2
Util.hxx
src/db/upnp/Util.hxx
+2
-2
No files found.
src/db/UpnpDatabasePlugin.cxx
View file @
54348561
...
...
@@ -105,7 +105,7 @@ protected:
private
:
bool
VisitServer
(
ContentDirectoryService
&
server
,
const
std
::
vector
<
std
::
string
>
&
vpath
,
const
std
::
list
<
std
::
string
>
&
vpath
,
const
DatabaseSelection
&
selection
,
VisitDirectory
visit_directory
,
VisitSong
visit_song
,
...
...
@@ -129,7 +129,7 @@ private:
Error
&
error
)
const
;
bool
Namei
(
ContentDirectoryService
&
server
,
const
std
::
vector
<
std
::
string
>
&
vpath
,
const
std
::
list
<
std
::
string
>
&
vpath
,
UPnPDirObject
&
dirent
,
Error
&
error
)
const
;
...
...
@@ -229,7 +229,8 @@ UpnpDatabase::GetSong(const char *uri, Error &error) const
if
(
!
m_superdir
->
getServer
(
vpath
.
front
().
c_str
(),
server
,
error
))
return
nullptr
;
vpath
.
erase
(
vpath
.
begin
());
vpath
.
pop_front
();
UPnPDirObject
dirent
;
if
(
vpath
.
front
()
!=
rootid
)
{
if
(
!
Namei
(
server
,
vpath
,
dirent
,
error
))
...
...
@@ -463,7 +464,7 @@ UpnpDatabase::BuildPath(ContentDirectoryService &server,
// Take server and internal title pathname and return objid and metadata.
bool
UpnpDatabase
::
Namei
(
ContentDirectoryService
&
server
,
const
std
::
vector
<
std
::
string
>
&
vpath
,
const
std
::
list
<
std
::
string
>
&
vpath
,
UPnPDirObject
&
odirent
,
Error
&
error
)
const
{
...
...
@@ -528,7 +529,7 @@ UpnpDatabase::Namei(ContentDirectoryService &server,
// really just one path parameter.
bool
UpnpDatabase
::
VisitServer
(
ContentDirectoryService
&
server
,
const
std
::
vector
<
std
::
string
>
&
vpath
,
const
std
::
list
<
std
::
string
>
&
vpath
,
const
DatabaseSelection
&
selection
,
VisitDirectory
visit_directory
,
VisitSong
visit_song
,
...
...
@@ -706,7 +707,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
// We do have a path: the first element selects the server
std
::
string
servername
(
std
::
move
(
vpath
.
front
()));
vpath
.
erase
(
vpath
.
begin
()
);
vpath
.
pop_front
(
);
ContentDirectoryService
server
;
if
(
!
m_superdir
->
getServer
(
servername
.
c_str
(),
server
,
error
))
...
...
src/db/upnp/Util.cxx
View file @
54348561
...
...
@@ -88,11 +88,11 @@ path_getfather(const std::string &s)
return
father
;
}
std
::
vector
<
std
::
string
>
std
::
list
<
std
::
string
>
stringToTokens
(
const
std
::
string
&
str
,
const
char
*
delims
,
bool
skipinit
)
{
std
::
vector
<
std
::
string
>
tokens
;
std
::
list
<
std
::
string
>
tokens
;
std
::
string
::
size_type
startPos
=
0
;
...
...
src/db/upnp/Util.hxx
View file @
54348561
...
...
@@ -23,7 +23,7 @@
#include "Compiler.h"
#include <string>
#include <
vector
>
#include <
list
>
std
::
string
caturl
(
const
std
::
string
&
s1
,
const
std
::
string
&
s2
);
...
...
@@ -36,7 +36,7 @@ std::string
path_getfather
(
const
std
::
string
&
s
);
gcc_pure
std
::
vector
<
std
::
string
>
std
::
list
<
std
::
string
>
stringToTokens
(
const
std
::
string
&
str
,
const
char
*
delims
=
"/"
,
bool
skipinit
=
true
);
...
...
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