Skip to content

Commit 23ce8e3

Browse files
committed
fix perf
1 parent 5f55f42 commit 23ce8e3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

opentelemetry/src/context.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,11 @@ impl Context {
493493

494494
#[cfg(feature = "trace")]
495495
pub(crate) fn current_with_synchronized_span(value: SynchronizedSpan) -> Self {
496-
Context {
496+
Self::map_current(|cx| Context {
497497
span: Some(Arc::new(value)),
498-
entries: Context::map_current(|cx| cx.entries.clone()),
499-
suppress_telemetry: Context::map_current(|cx| cx.suppress_telemetry),
500-
// TODO: Do this while inside the `map_current` closure
501-
}
498+
entries: cx.entries.clone(),
499+
suppress_telemetry: cx.suppress_telemetry,
500+
})
502501
}
503502

504503
#[cfg(feature = "trace")]

0 commit comments

Comments
 (0)