diff --git a/include/libtorrent/settings_pack.hpp b/include/libtorrent/settings_pack.hpp index 78bd4306d..6ad91dc00 100644 --- a/include/libtorrent/settings_pack.hpp +++ b/include/libtorrent/settings_pack.hpp @@ -67,7 +67,7 @@ namespace libtorrent { , aux::session_impl* ses = nullptr); TORRENT_EXTRA_EXPORT void run_all_updates(aux::session_impl& ses); - TORRENT_EXPORT int setting_by_name(std::string const& name); + TORRENT_EXPORT int setting_by_name(string_view name); TORRENT_EXPORT char const* name_for_setting(int s); // returns a settings_pack with every setting set to its default value diff --git a/src/settings_pack.cpp b/src/settings_pack.cpp index e0d664f77..d889800db 100644 --- a/src/settings_pack.cpp +++ b/src/settings_pack.cpp @@ -350,7 +350,7 @@ constexpr int CLOSE_FILE_INTERVAL = 0; } // anonymous namespace - int setting_by_name(std::string const& key) + int setting_by_name(string_view const key) { for (int k = 0; k < str_settings.end_index(); ++k) {