aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-22 09:40:30 +0100
committerMax Kellermann <max@duempel.org>2014-01-22 09:40:38 +0100
commit2722b8a3df356bdb36fe498fb2bbc709e5ae4bc1 (patch)
tree3b8f33cc513e7a58908d54965a023b3e20dc6f47
parentfd754ff8f86d212b2db8410a232bd3d71bcb4f60 (diff)
downloadmpd-2722b8a3df356bdb36fe498fb2bbc709e5ae4bc1.tar.gz
mpd-2722b8a3df356bdb36fe498fb2bbc709e5ae4bc1.tar.xz
mpd-2722b8a3df356bdb36fe498fb2bbc709e5ae4bc1.zip
db/upnp/Util: "emplace" items into the list
Reduce overhead.
-rw-r--r--src/db/upnp/Util.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db/upnp/Util.cxx b/src/db/upnp/Util.cxx
index 383e23074..9b223aca9 100644
--- a/src/db/upnp/Util.cxx
+++ b/src/db/upnp/Util.cxx
@@ -107,15 +107,15 @@ stringToTokens(const std::string &str,
// Add token to the vector and adjust start
if (pos == std::string::npos) {
- tokens.push_back(str.substr(startPos));
+ tokens.emplace_back(str, startPos);
break;
} else if (pos == startPos) {
// Dont' push empty tokens after first
if (tokens.empty())
- tokens.push_back(std::string());
+ tokens.emplace_back();
startPos = ++pos;
} else {
- tokens.push_back(str.substr(startPos, pos - startPos));
+ tokens.emplace_back(str, startPos, pos - startPos);
startPos = ++pos;
}
}