diff --git a/src/lib/upnp/Util.cxx b/src/lib/upnp/Util.cxx index fef1cd5c7..57800a845 100644 --- a/src/lib/upnp/Util.cxx +++ b/src/lib/upnp/Util.cxx @@ -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()) diff --git a/src/lib/upnp/Util.hxx b/src/lib/upnp/Util.hxx index 44423a39e..25e8ff9a4 100644 --- a/src/lib/upnp/Util.hxx +++ b/src/lib/upnp/Util.hxx @@ -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 @@ -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;