From 0defd927f3a483de56e0d768345bce9e7266be24 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Wed, 22 Jan 2014 21:41:05 +0100
Subject: [PATCH] db/upnp: use std::list instead of std::set for
 SearchCapabilities

Reduce bloat.  We never used the set lookup.
---
 src/db/UpnpDatabasePlugin.cxx           | 2 +-
 src/db/upnp/ContentDirectoryService.cxx | 2 +-
 src/db/upnp/ContentDirectoryService.hxx | 4 ++--
 src/db/upnp/Util.cxx                    | 8 +++-----
 4 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index abab93dcc..21b9e19f5 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -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;
 
diff --git a/src/db/upnp/ContentDirectoryService.cxx b/src/db/upnp/ContentDirectoryService.cxx
index af7ce949b..2f9565d95 100644
--- a/src/db/upnp/ContentDirectoryService.cxx
+++ b/src/db/upnp/ContentDirectoryService.cxx
@@ -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());
diff --git a/src/db/upnp/ContentDirectoryService.hxx b/src/db/upnp/ContentDirectoryService.hxx
index bf1024c32..035849681 100644
--- a/src/db/upnp/ContentDirectoryService.hxx
+++ b/src/db/upnp/ContentDirectoryService.hxx
@@ -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. */
diff --git a/src/db/upnp/Util.cxx b/src/db/upnp/Util.cxx
index df731f94d..fba63983d 100644
--- a/src/db/upnp/Util.cxx
+++ b/src/db/upnp/Util.cxx
@@ -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> &);