lib/upnp/Device: pass url as std::string_view to Parse()

This commit is contained in:
Max Kellermann 2024-01-04 13:02:06 +01:00
parent d5f7db59a8
commit 4c9942534c
3 changed files with 4 additions and 7 deletions

View File

@ -79,7 +79,7 @@ protected:
}; };
void void
UPnPDevice::Parse(const std::string &url, const char *description) UPnPDevice::Parse(const std::string_view url, const char *description)
{ {
{ {
UPnPDeviceParser mparser(*this); UPnPDeviceParser mparser(*this);

View File

@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project // Copyright The Music Player Daemon Project
#ifndef _UPNPDEV_HXX_INCLUDED_ #pragma once
#define _UPNPDEV_HXX_INCLUDED_
#include <vector> #include <vector>
#include <string> #include <string>
@ -57,7 +56,5 @@ public:
* @param url where the description came from * @param url where the description came from
* @param description the xml device description * @param description the xml device description
*/ */
void Parse(const std::string &url, const char *description); void Parse(std::string_view url, const char *description);
}; };
#endif /* _UPNPDEV_HXX_INCLUDED_ */

View File

@ -55,7 +55,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
:id(std::move(_id)), :id(std::move(_id)),
expires(last + exp + std::chrono::seconds(20)) {} expires(last + exp + std::chrono::seconds(20)) {}
void Parse(const std::string &url, const char *description) { void Parse(std::string_view url, const char *description) {
device.Parse(url, description); device.Parse(url, description);
} }
}; };