From ad76bad8fd8a0fa1a0e653faf52d8eeb7375f9b2 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Sat, 18 Jan 2014 13:39:31 +0100
Subject: db/upnp: use move operator to assign XML CDATA

Reduce runtime bloat.
---
 src/db/upnp/Device.cxx    | 22 +++++++++++-----------
 src/db/upnp/Directory.cxx |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

(limited to 'src/db/upnp')

diff --git a/src/db/upnp/Device.cxx b/src/db/upnp/Device.cxx
index c947f5a14..609f2cbfc 100644
--- a/src/db/upnp/Device.cxx
+++ b/src/db/upnp/Device.cxx
@@ -60,40 +60,40 @@ protected:
 		switch (m_path.back()[0]) {
 		case 'c':
 			if (!m_path.back().compare("controlURL"))
-				m_tservice.controlURL += str;
+				m_tservice.controlURL = std::move(str);
 			break;
 		case 'd':
 			if (!m_path.back().compare("deviceType"))
-				m_device.deviceType += str;
+				m_device.deviceType = std::move(str);
 			break;
 		case 'e':
 			if (!m_path.back().compare("eventSubURL"))
-				m_tservice.eventSubURL += str;
+				m_tservice.eventSubURL = std::move(str);
 			break;
 		case 'f':
 			if (!m_path.back().compare("friendlyName"))
-				m_device.friendlyName += str;
+				m_device.friendlyName = std::move(str);
 			break;
 		case 'm':
 			if (!m_path.back().compare("manufacturer"))
-				m_device.manufacturer += str;
+				m_device.manufacturer = std::move(str);
 			else if (!m_path.back().compare("modelName"))
-				m_device.modelName += str;
+				m_device.modelName = std::move(str);
 			break;
 		case 's':
 			if (!m_path.back().compare("serviceType"))
-				m_tservice.serviceType = str;
+				m_tservice.serviceType = std::move(str);
 			else if (!m_path.back().compare("serviceId"))
-				m_tservice.serviceId += str;
+				m_tservice.serviceId = std::move(str);
 		case 'S':
 			if (!m_path.back().compare("SCPDURL"))
-				m_tservice.SCPDURL = str;
+				m_tservice.SCPDURL = std::move(str);
 			break;
 		case 'U':
 			if (!m_path.back().compare("UDN"))
-				m_device.UDN = str;
+				m_device.UDN = std::move(str);
 			else if (!m_path.back().compare("URLBase"))
-				m_device.URLBase += str;
+				m_device.URLBase = std::move(str);
 			break;
 		}
 	}
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx
index 757e2e19d..00ce68816 100644
--- a/src/db/upnp/Directory.cxx
+++ b/src/db/upnp/Directory.cxx
@@ -172,7 +172,7 @@ protected:
 		switch (m_path.back()[0]) {
 		case 'r':
 			if (!m_path.back().compare("res")) {
-				m_tobj.url = str;
+				m_tobj.url = std::move(str);
 			}
 			break;
 		case 'u':
-- 
cgit v1.2.3