db/upnp: use std::list instead of std::set for SearchCapabilities
Reduce bloat. We never used the set lookup.
This commit is contained in:
parent
6c41e8f63f
commit
0defd927f3
@ -281,7 +281,7 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server,
|
|||||||
if (selection.filter == nullptr)
|
if (selection.filter == nullptr)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
std::set<std::string> searchcaps;
|
std::list<std::string> searchcaps;
|
||||||
if (!server.getSearchCapabilities(m_lib->getclh(), searchcaps, error))
|
if (!server.getSearchCapabilities(m_lib->getclh(), searchcaps, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
|
ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
|
||||||
std::set<std::string> &result,
|
std::list<std::string> &result,
|
||||||
Error &error)
|
Error &error)
|
||||||
{
|
{
|
||||||
assert(result.empty());
|
assert(result.empty());
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <upnp/upnp.h>
|
#include <upnp/upnp.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <set>
|
#include <list>
|
||||||
|
|
||||||
class Error;
|
class Error;
|
||||||
class UPnPDevice;
|
class UPnPDevice;
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
* any tag can be used in a search, or a list of usable tag names.
|
* any tag can be used in a search, or a list of usable tag names.
|
||||||
*/
|
*/
|
||||||
bool getSearchCapabilities(UpnpClient_Handle handle,
|
bool getSearchCapabilities(UpnpClient_Handle handle,
|
||||||
std::set<std::string> &result,
|
std::list<std::string> &result,
|
||||||
Error &error);
|
Error &error);
|
||||||
|
|
||||||
/** Retrieve the "friendly name" for this server, useful for display. */
|
/** Retrieve the "friendly name" for this server, useful for display. */
|
||||||
|
@ -153,7 +153,7 @@ csvToStrings(const char *s, T &tokens)
|
|||||||
case ',':
|
case ',':
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case TOKEN:
|
case TOKEN:
|
||||||
tokens.insert(tokens.end(), current);
|
tokens.push_back(current);
|
||||||
current.clear();
|
current.clear();
|
||||||
continue;
|
continue;
|
||||||
case ESCAPE:
|
case ESCAPE:
|
||||||
@ -187,7 +187,7 @@ csvToStrings(const char *s, T &tokens)
|
|||||||
}
|
}
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case TOKEN:
|
case TOKEN:
|
||||||
tokens.insert(tokens.end(), current);
|
tokens.push_back(current);
|
||||||
break;
|
break;
|
||||||
case ESCAPE:
|
case ESCAPE:
|
||||||
return false;
|
return false;
|
||||||
@ -195,6 +195,4 @@ csvToStrings(const char *s, T &tokens)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//template bool csvToStrings<list<string> >(const string &, list<string> &);
|
template bool csvToStrings<std::list<std::string>>(const char *, std::list<std::string> &);
|
||||||
template bool csvToStrings<std::vector<std::string> >(const char *, std::vector<std::string> &);
|
|
||||||
template bool csvToStrings<std::set<std::string> >(const char *, std::set<std::string> &);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user