mirror of
https://github.com/espressif/openthread.git
synced 2026-08-27 20:39:54 +00:00
[dns-dso] use Array::RemoveMatching() (#7817)
This commit is contained in:
committed by
Jonathan Hui
parent
aad14e9f2f
commit
16ddb157d0
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user