Avoid unnecessary nullptr assignment

We can just leave the dangling pointer value in the `run` object: even
though we just deleted it, there's no need to reset this value because
it will never be used again.  (And even if we did, we don't check
against nullptr anyway so having a nullptr here doesn't make anything
safter than a dangling pointer).

The assignment (into the variant) uses a small amount of CPU (via
std::variant), so better for performance to just leave it dangling.
This commit is contained in:
Jason Rhinelander 2022-05-12 12:48:46 -03:00
parent 62a803f371
commit ace6ea9d8e
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
1 changed files with 0 additions and 1 deletions

View File

@ -247,7 +247,6 @@ void OxenMQ::proxy_worker_message(OxenMQ::control_message_array& parts, size_t l
if (clear_job) {
delete batch;
run.to_run = static_cast<detail::Batch*>(nullptr);
}
} else {
assert(run.cat->active_threads > 0);