From 76483a9efa0459c51985b72473095e294767aafe Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Mon, 26 Apr 2021 22:31:24 -0700 Subject: [PATCH] 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. --- src/Val.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Val.cc b/src/Val.cc index 06499f9c6e..bbb86bb3d5 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -2542,14 +2542,12 @@ void TableVal::DoExpire(double t) expire_iterator = new RobustDictIterator(std::move(it)); } - TableEntryVal* v = nullptr; - TableEntryVal* v_saved = nullptr; bool modified = false; for ( int i = 0; i < zeek::detail::table_incremental_step && *expire_iterator != table_val->end_robust(); ++i, ++(*expire_iterator) ) { - v = (*expire_iterator)->GetValue(); + auto v = (*expire_iterator)->GetValue(); if ( v->ExpireAccessTime() == 0 ) { @@ -2573,12 +2571,10 @@ void TableVal::DoExpire(double t) // It's possible that the user-provided // function modified or deleted the table // value, so look it up again. - v_saved = v; v = table_val->Lookup(k.get()); if ( ! v ) { // user-provided function deleted it - v = v_saved; continue; }