pull/2157/merge
WeidiDeng 2024-07-05 08:12:55 +02:00 committed by GitHub
commit 15551087ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View File

@ -109,10 +109,15 @@ void AnnounceList::announceSuccess()
if (currentTrackerInitialized_) { if (currentTrackerInitialized_) {
(*currentTier_)->nextEvent(); (*currentTier_)->nextEvent();
auto url = *currentTracker_; auto url = *currentTracker_;
(*currentTier_)->urls.erase(currentTracker_); currentTracker_ = (*currentTier_)->urls.erase(currentTracker_);
(*currentTier_)->urls.push_front(std::move(url)); (*currentTier_)->urls.push_front(std::move(url));
currentTier_ = std::begin(tiers_); if (currentTracker_ == std::end((*currentTier_)->urls)) {
currentTracker_ = std::begin((*currentTier_)->urls); ++currentTier_;
if (currentTier_ == std::end(tiers_)) {
currentTier_ = std::begin(tiers_);
}
currentTracker_ = std::begin((*currentTier_)->urls);
}
} }
} }

View File

@ -95,8 +95,9 @@ public:
/** /**
* Removes current announce URL from its group and inserts it before the * Removes current announce URL from its group and inserts it before the
* first element of the group. * first element of the group.
* The internal announce group pointer points to the first element of the * The internal announce group pointer points to the next element.
* first group after this call. * If the current URL is the last element of its group, then the first
* element of the next group is pointed.
*/ */
void announceSuccess(); void announceSuccess();