Skip to content

Commit

Permalink
perf: Class lookup optimization
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Weinand <[email protected]>
  • Loading branch information
PROFeNoM and bwoebi authored Sep 16, 2024
1 parent 1d924b4 commit 41ade00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DDTrace/OpenTelemetry/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public static function setStorage(ContextStorageInterface $storage): void
public static function storage(): ContextStorageInterface
{
if (self::$storageClass === '') {
self::$storageClass = class_exists('\OpenTelemetry\Context\FiberBoundContextStorageExecutionAwareBC')
? '\OpenTelemetry\Context\FiberBoundContextStorageExecutionAwareBC' // v1.1+
: '\OpenTelemetry\Context\ContextStorage';
self::$storageClass = class_exists('OpenTelemetry\Context\FiberBoundContextStorageExecutionAwareBC')
? 'OpenTelemetry\Context\FiberBoundContextStorageExecutionAwareBC' // v1.1+
: 'OpenTelemetry\Context\ContextStorage';
}

return self::$storage ??= new self::$storageClass();
Expand Down

0 comments on commit 41ade00

Please sign in to comment.