From 55737e4ff63df685f1603eadc3105cda38b7da9b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 18 Jan 2014 13:36:50 +0100 Subject: db/upnp/Util: trimstring() constructs string from buffer Reduce overhead by omitting the part of the buffer that consists only of whitespace. --- src/db/upnp/Directory.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/db/upnp/Directory.cxx') diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index 3b6428389..757e2e19d 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -156,8 +156,7 @@ protected: virtual void CharacterData(const XML_Char *s, int len) { - std::string str(s, len); - trimstring(str); + std::string str = trimstring(s, len); TagType type = tag_table_lookup(upnp_tags, m_path.back().c_str()); -- cgit v1.2.3