From d4135935e4a747e8d8a064a5d5fcda895c57da73 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Mar 2020 17:59:07 +0100 Subject: [PATCH] lib/upnp/Util: remove unused function stringToTokens() --- src/lib/upnp/Util.cxx | 34 ---------------------------------- src/lib/upnp/Util.hxx | 7 ------- 2 files changed, 41 deletions(-) diff --git a/src/lib/upnp/Util.cxx b/src/lib/upnp/Util.cxx index 5a9b69e63..00a38ca4e 100644 --- a/src/lib/upnp/Util.cxx +++ b/src/lib/upnp/Util.cxx @@ -66,37 +66,3 @@ path_getfather(const std::string &s) noexcept path_catslash(father); return father; } - -std::list -stringToTokens(const std::string &str, - const char delim) noexcept -{ - std::list tokens; - - std::string::size_type startPos = str.find_first_not_of(delim, 0); - - // Skip initial delims, return empty if this eats all. - if (startPos == std::string::npos) - return tokens; - - while (startPos < str.size()) { - // Find next delimiter or end of string (end of token) - auto pos = str.find_first_of(delim, startPos); - - // Add token to the vector and adjust start - if (pos == std::string::npos) { - tokens.emplace_back(str, startPos); - break; - } else if (pos == startPos) { - // Dont' push empty tokens after first - if (tokens.empty()) - tokens.emplace_back(); - startPos = ++pos; - } else { - tokens.emplace_back(str, startPos, pos - startPos); - startPos = ++pos; - } - } - - return tokens; -} diff --git a/src/lib/upnp/Util.hxx b/src/lib/upnp/Util.hxx index 7cba1c4b2..5256dfebb 100644 --- a/src/lib/upnp/Util.hxx +++ b/src/lib/upnp/Util.hxx @@ -20,10 +20,7 @@ #ifndef MPD_UPNP_UTIL_HXX #define MPD_UPNP_UTIL_HXX -#include "util/Compiler.h" - #include -#include void trimstring(std::string &s, const char *ws = " \t\n") noexcept; @@ -31,8 +28,4 @@ trimstring(std::string &s, const char *ws = " \t\n") noexcept; std::string path_getfather(const std::string &s) noexcept; -gcc_pure -std::list -stringToTokens(const std::string &str, char delim) noexcept; - #endif /* _UPNPP_H_X_INCLUDED_ */