Skip to content

Commit

Permalink
optimize ClassConstantAccessor
Browse files Browse the repository at this point in the history
string concat is about 10x faster than sprintf, so use it here since it's called many times
  • Loading branch information
brettmc committed Jan 15, 2024
1 parent 0e13117 commit bd00dd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SDK/Common/Util/ClassConstantAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public static function getValue(string $className, string $constantName)

private static function getFullName(string $className, string $constantName): string
{
return sprintf('%s::%s', $className, $constantName);
return $className . '::' . $constantName;
}
}

0 comments on commit bd00dd2

Please sign in to comment.