mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Remove saving/restoring of value pointer after calling expire_func
It's no longer used for anything. Previously, it was used to detect whether the expiry batch finished iterating the entire table or not, but that's now determined by directly checking if the iterator itself signifies the end of the table.
This commit is contained in:
parent
f28a648057
commit
76483a9efa
1 changed files with 1 additions and 5 deletions
|
@ -2542,14 +2542,12 @@ void TableVal::DoExpire(double t)
|
||||||
expire_iterator = new RobustDictIterator(std::move(it));
|
expire_iterator = new RobustDictIterator(std::move(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
TableEntryVal* v = nullptr;
|
|
||||||
TableEntryVal* v_saved = nullptr;
|
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
|
|
||||||
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) )
|
||||||
{
|
{
|
||||||
v = (*expire_iterator)->GetValue<TableEntryVal*>();
|
auto v = (*expire_iterator)->GetValue<TableEntryVal*>();
|
||||||
|
|
||||||
if ( v->ExpireAccessTime() == 0 )
|
if ( v->ExpireAccessTime() == 0 )
|
||||||
{
|
{
|
||||||
|
@ -2573,12 +2571,10 @@ void TableVal::DoExpire(double t)
|
||||||
// It's possible that the user-provided
|
// It's possible that the user-provided
|
||||||
// function modified or deleted the table
|
// function modified or deleted the table
|
||||||
// value, so look it up again.
|
// value, so look it up again.
|
||||||
v_saved = v;
|
|
||||||
v = table_val->Lookup(k.get());
|
v = table_val->Lookup(k.get());
|
||||||
|
|
||||||
if ( ! v )
|
if ( ! v )
|
||||||
{ // user-provided function deleted it
|
{ // user-provided function deleted it
|
||||||
v = v_saved;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue