mirror of
https://github.com/transmission/transmission.git
synced 2026-04-19 16:31:13 +01:00
fix: enable modernize-use-ranges (#8626)
* fix(core): enable `modernize-use-ranges` * fix(test): enable `modernize-use-ranges` * fix(qt): enable `modernize-use-ranges` * fix(gtk): enable `modernize-use-ranges`
This commit is contained in:
@@ -22,7 +22,6 @@ Checks:
|
||||
- misc-*
|
||||
- -misc-include-cleaner
|
||||
- modernize-*
|
||||
- -modernize-use-ranges
|
||||
- -modernize-use-trailing-return-type
|
||||
- performance-*
|
||||
- readability-*
|
||||
|
||||
@@ -896,7 +896,7 @@ void Application::Impl::on_drag_data_received(
|
||||
{
|
||||
auto files = std::vector<Glib::RefPtr<Gio::File>>();
|
||||
files.reserve(uris.size());
|
||||
std::transform(uris.begin(), uris.end(), std::back_inserter(files), &Gio::File::create_for_uri);
|
||||
std::ranges::transform(uris, std::back_inserter(files), &Gio::File::create_for_uri);
|
||||
|
||||
open_files(files);
|
||||
}
|
||||
|
||||
@@ -200,9 +200,14 @@ bool FilterBar::Impl::tracker_filter_model_update()
|
||||
std::string sitename;
|
||||
std::string announce_url;
|
||||
|
||||
bool operator<(site_info const& that) const
|
||||
TR_CONSTEXPR_STR auto operator<=>(site_info const& that) const noexcept
|
||||
{
|
||||
return sitename < that.sitename;
|
||||
return sitename <=> that.sitename;
|
||||
}
|
||||
|
||||
TR_CONSTEXPR_STR auto operator==(site_info const& that) const
|
||||
{
|
||||
return sitename == that.sitename;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -245,7 +250,7 @@ bool FilterBar::Impl::tracker_filter_model_update()
|
||||
auto const n_sites = std::size(site_infos);
|
||||
auto sites_v = std::vector<site_info>(n_sites);
|
||||
std::ranges::transform(site_infos, std::begin(sites_v), [](auto const& it) { return it.second; });
|
||||
std::sort(std::begin(sites_v), std::end(sites_v));
|
||||
std::ranges::sort(sites_v);
|
||||
|
||||
// update the "all" count
|
||||
auto iter = tracker_model_->children().begin();
|
||||
|
||||
Reference in New Issue
Block a user