mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibDNS: Fix check for cache entries that can be removed
Co-authored-by: Ali Mohammad Pur <ali.mpfard@gmail.com>
This commit is contained in:
parent
26825b5865
commit
4904326244
Notes:
github-actions[bot]
2025-02-11 06:25:35 +00:00
Author: https://github.com/rmg-x Commit: https://github.com/LadybirdBrowser/ladybird/commit/49043262443 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3523 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/alimpfard
1 changed files with 2 additions and 2 deletions
|
@ -98,7 +98,7 @@ public:
|
|||
void set_id(u16 id) { m_id = id; }
|
||||
u16 id() { return m_id; }
|
||||
|
||||
bool is_valid() const { return m_valid && m_request_done; }
|
||||
bool can_be_removed() const { return !m_valid && m_request_done; }
|
||||
Messages::DomainName const& name() const { return m_name; }
|
||||
|
||||
private:
|
||||
|
@ -518,7 +518,7 @@ private:
|
|||
HashTable<ByteString> to_remove;
|
||||
for (auto& entry : cache) {
|
||||
entry.value->check_expiration();
|
||||
if (!entry.value->is_valid())
|
||||
if (entry.value->can_be_removed())
|
||||
to_remove.set(entry.key);
|
||||
}
|
||||
for (auto const& key : to_remove)
|
||||
|
|
Loading…
Add table
Reference in a new issue