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/Util.hxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/db/upnp/Util.hxx') diff --git a/src/db/upnp/Util.hxx b/src/db/upnp/Util.hxx index 08fe5f497..ba5633331 100644 --- a/src/db/upnp/Util.hxx +++ b/src/db/upnp/Util.hxx @@ -28,8 +28,9 @@ std::string caturl(const std::string& s1, const std::string& s2); -void -trimstring(std::string &s, const char *ws = " \t\n"); +gcc_pure +std::string +trimstring(const char *p, size_t length); std::string path_getfather(const std::string &s); -- cgit v1.2.3