[dns-dso] use Array::RemoveMatching() (#7817)

This commit is contained in:
Abtin Keshavarzian
2022-06-16 21:26:03 -07:00
committed by Jonathan Hui
parent aad14e9f2f
commit 16ddb157d0
+1 -14
View File
@@ -1409,20 +1409,7 @@ exit:
void Dso::Connection::PendingRequests::Remove(MessageId aMessageId)
{
Entry *entry = mRequests.FindMatching(aMessageId);
Entry *lastEntry;
VerifyOrExit(entry != nullptr);
// Remove last entry from the `mRequests` array, if it is not the
// `entry` we want to remove, replace `entry` with `lastEntry.
lastEntry = mRequests.PopBack();
VerifyOrExit(lastEntry != entry);
*entry = *lastEntry;
exit:
return;
mRequests.RemoveMatching(aMessageId);
}
bool Dso::Connection::PendingRequests::HasAnyTimedOut(TimeMilli aNow) const