util/SplitString: convert return value to std::string_view
Eliminates lots of overhead.
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "ixmlwrap.hxx"
|
||||
#include "util/UriRelative.hxx"
|
||||
#include "util/RuntimeError.hxx"
|
||||
#include "util/SplitString.hxx"
|
||||
#include "util/IterableSplitString.hxx"
|
||||
|
||||
#include <upnptools.h>
|
||||
|
||||
@@ -73,5 +73,8 @@ ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl) const
|
||||
understand that */
|
||||
return std::forward_list<std::string>();
|
||||
|
||||
return SplitString(s, ',', false);
|
||||
std::forward_list<std::string> result;
|
||||
for (const auto &i : IterableSplitString(s, ','))
|
||||
result.emplace_front(i);
|
||||
return result;
|
||||
}
|
||||
|
@@ -325,7 +325,7 @@ UPnPDeviceDirectory::GetDirectories()
|
||||
}
|
||||
|
||||
ContentDirectoryService
|
||||
UPnPDeviceDirectory::GetServer(const char *friendly_name)
|
||||
UPnPDeviceDirectory::GetServer(std::string_view friendly_name)
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
|
||||
|
@@ -176,7 +176,7 @@ public:
|
||||
/**
|
||||
* Get server by friendly name.
|
||||
*/
|
||||
ContentDirectoryService GetServer(const char *friendly_name);
|
||||
ContentDirectoryService GetServer(std::string_view friendly_name);
|
||||
|
||||
private:
|
||||
void Search();
|
||||
|
Reference in New Issue
Block a user