Skip to content

Commit

Permalink
Optimize the tracer component by replacing the direct instantiation w…
Browse files Browse the repository at this point in the history
…ith a closure at Context::getOrSet. (#6315)



Co-authored-by: 李铭昕 <[email protected]>
  • Loading branch information
xuanyanwow and limingxinleo authored Nov 23, 2023
1 parent ae9abcc commit c01f1de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TracerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function setTracer(Tracer $tracer): Tracer

public static function getTracer(): Tracer
{
return Context::getOrSet(self::TRACER, make(Tracer::class));
return Context::getOrSet(self::TRACER, fn () => make(Tracer::class));
}

public static function setRoot(Span $root): Span
Expand Down

0 comments on commit c01f1de

Please sign in to comment.