mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 10:28:32 +00:00
refactor: fix readability-redundant-string-cstr warnings found by clang-tidy-16 (#4529)
This commit is contained in:
@@ -474,7 +474,7 @@ tr_device_info tr_device_info_create(std::string_view path)
|
|||||||
out.path = path;
|
out.path = path;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
out.device = getblkdev(out.path);
|
out.device = getblkdev(out.path);
|
||||||
auto const* const fstype = getfstype(out.path.c_str());
|
auto const* const fstype = getfstype(out.path);
|
||||||
out.fstype = fstype != nullptr ? fstype : "";
|
out.fstype = fstype != nullptr ? fstype : "";
|
||||||
#endif
|
#endif
|
||||||
return out;
|
return out;
|
||||||
|
|||||||
@@ -382,10 +382,7 @@ static bool isHostnameAllowed(tr_rpc_server const* server, evhttp_request const*
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto const& src = server->host_whitelist_;
|
auto const& src = server->host_whitelist_;
|
||||||
return std::any_of(
|
return std::any_of(std::begin(src), std::end(src), [&hostname](auto const& str) { return tr_wildmat(hostname, str); });
|
||||||
std::begin(src),
|
|
||||||
std::end(src),
|
|
||||||
[&hostname](auto const& str) { return tr_wildmat(hostname.c_str(), str.c_str()); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool test_session_id(tr_rpc_server const* server, evhttp_request const* req)
|
static bool test_session_id(tr_rpc_server const* server, evhttp_request const* req)
|
||||||
|
|||||||
Reference in New Issue
Block a user