Avoid uselessly computing turn descriptions when there is no listener for them

This commit is contained in:
Tony Garnock-Jones 2024-03-03 14:15:56 +01:00
parent 41cf85f865
commit b7d4bd4b58
1 changed files with 2 additions and 1 deletions

View File

@ -1826,8 +1826,9 @@ impl Actor {
boot: F,
) -> ActorHandle {
let ac = Actor::new(None, trace_collector.clone());
let topcause = trace_collector.as_ref().map(|_| trace::TurnCause::external("top-level actor"));
let account = Account::new(None, trace_collector);
ac.boot(None, account, Some(trace::TurnCause::external("top-level actor")), boot)
ac.boot(None, account, topcause, boot)
}
/// Create a new actor. It still needs to be [`boot`ed][Self::boot].