Skip to content

Commit

Permalink
perf(TransformerRegistry): Optimize caching.
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jan 24, 2024
1 parent caef4fd commit ccd6c6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* fix: Fix static analysis issues.
* perf(`TransformerRegistry`): Optimize sorting.
* perf(`TransformerRegistry`): Optimize caching.

## 0.5.16

Expand Down
2 changes: 1 addition & 1 deletion src/TransformerRegistry/CachingTransformerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function findBySourceAndTargetTypes(
array $sourceTypes,
array $targetTypes,
): SearchResult {
$cacheKey = md5(serialize($sourceTypes) . '--' . serialize($targetTypes));
$cacheKey = \rawurlencode(serialize($sourceTypes) . '--' . serialize($targetTypes));

if (isset($this->findBySourceAndTargetTypesCache[$cacheKey])) {
return $this->findBySourceAndTargetTypesCache[$cacheKey];
Expand Down

0 comments on commit ccd6c6e

Please sign in to comment.