Commit 0defd927 authored by Max Kellermann's avatar Max Kellermann

db/upnp: use std::list instead of std::set for SearchCapabilities

Reduce bloat. We never used the set lookup.
parent 6c41e8f6
......@@ -281,7 +281,7 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server,
if (selection.filter == nullptr)
return true;
std::set<std::string> searchcaps;
std::list<std::string> searchcaps;
if (!server.getSearchCapabilities(m_lib->getclh(), searchcaps, error))
return false;
......
......@@ -188,7 +188,7 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
bool
ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
std::set<std::string> &result,
std::list<std::string> &result,
Error &error)
{
assert(result.empty());
......
......@@ -23,7 +23,7 @@
#include <upnp/upnp.h>
#include <string>
#include <set>
#include <list>
class Error;
class UPnPDevice;
......@@ -114,7 +114,7 @@ public:
* any tag can be used in a search, or a list of usable tag names.
*/
bool getSearchCapabilities(UpnpClient_Handle handle,
std::set<std::string> &result,
std::list<std::string> &result,
Error &error);
/** Retrieve the "friendly name" for this server, useful for display. */
......
......@@ -153,7 +153,7 @@ csvToStrings(const char *s, T &tokens)
case ',':
switch(state) {
case TOKEN:
tokens.insert(tokens.end(), current);
tokens.push_back(current);
current.clear();
continue;
case ESCAPE:
......@@ -187,7 +187,7 @@ csvToStrings(const char *s, T &tokens)
}
switch(state) {
case TOKEN:
tokens.insert(tokens.end(), current);
tokens.push_back(current);
break;
case ESCAPE:
return false;
......@@ -195,6 +195,4 @@ csvToStrings(const char *s, T &tokens)
return true;
}
//template bool csvToStrings<list<string> >(const string &, list<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> &);
template bool csvToStrings<std::list<std::string>>(const char *, std::list<std::string> &);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment