lib/upnp/Util: pass std::string_view to path_getfather()

This commit is contained in:
Max Kellermann 2024-01-04 13:03:31 +01:00
parent 8d1b73ae89
commit d5f7db59a8
2 changed files with 4 additions and 7 deletions

View File

@ -27,9 +27,9 @@ path_catslash(std::string &s) noexcept
}
std::string
path_getfather(const std::string &s) noexcept
path_getfather(const std::string_view s) noexcept
{
std::string father = s;
std::string father{s};
// ??
if (father.empty())

View File

@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
// Copyright The Music Player Daemon Project
#ifndef MPD_UPNP_UTIL_HXX
#define MPD_UPNP_UTIL_HXX
#pragma once
#include <string>
@ -10,6 +9,4 @@ void
trimstring(std::string &s, const char *ws = " \t\n") noexcept;
std::string
path_getfather(const std::string &s) noexcept;
#endif /* _UPNPP_H_X_INCLUDED_ */
path_getfather(std::string_view s) noexcept;