mirror of https://github.com/oxen-io/oxen-mq.git
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:
parent
62a803f371
commit
ace6ea9d8e
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue