perf: skip some excess announce list rebuilds

This commit is contained in:
Charles Kerr
2022-02-20 21:25:49 -06:00
parent 8d5c900ee0
commit 3780f90ef5
6 changed files with 71 additions and 25 deletions

View File

@@ -92,6 +92,16 @@ public:
[[nodiscard]] tr_tracker_tier_t nextTier() const;
[[nodiscard]] bool operator==(tr_announce_list const& that) const
{
return trackers_ == that.trackers_;
}
[[nodiscard]] bool operator!=(tr_announce_list const& that) const
{
return trackers_ != that.trackers_;
}
bool add(std::string_view announce_url_sv)
{
return add(announce_url_sv, this->nextTier());