mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Avoid allocating a HashKey for no-op table expiry iterations
This commit is contained in:
parent
b44ae62ce4
commit
f28a648057
1 changed files with 1 additions and 2 deletions
|
@ -2542,7 +2542,6 @@ void TableVal::DoExpire(double t)
|
||||||
expire_iterator = new RobustDictIterator(std::move(it));
|
expire_iterator = new RobustDictIterator(std::move(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<detail::HashKey> k = nullptr;
|
|
||||||
TableEntryVal* v = nullptr;
|
TableEntryVal* v = nullptr;
|
||||||
TableEntryVal* v_saved = nullptr;
|
TableEntryVal* v_saved = nullptr;
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
|
@ -2550,7 +2549,6 @@ void TableVal::DoExpire(double t)
|
||||||
for ( int i = 0; i < zeek::detail::table_incremental_step &&
|
for ( int i = 0; i < zeek::detail::table_incremental_step &&
|
||||||
*expire_iterator != table_val->end_robust(); ++i, ++(*expire_iterator) )
|
*expire_iterator != table_val->end_robust(); ++i, ++(*expire_iterator) )
|
||||||
{
|
{
|
||||||
k = (*expire_iterator)->GetHashKey();
|
|
||||||
v = (*expire_iterator)->GetValue<TableEntryVal*>();
|
v = (*expire_iterator)->GetValue<TableEntryVal*>();
|
||||||
|
|
||||||
if ( v->ExpireAccessTime() == 0 )
|
if ( v->ExpireAccessTime() == 0 )
|
||||||
|
@ -2564,6 +2562,7 @@ void TableVal::DoExpire(double t)
|
||||||
|
|
||||||
else if ( v->ExpireAccessTime() + timeout < t )
|
else if ( v->ExpireAccessTime() + timeout < t )
|
||||||
{
|
{
|
||||||
|
auto k = (*expire_iterator)->GetHashKey();
|
||||||
ListValPtr idx = nullptr;
|
ListValPtr idx = nullptr;
|
||||||
|
|
||||||
if ( expire_func )
|
if ( expire_func )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue