8000 [Cache] Upgrade TagAwareAdapter · symfony/symfony@0f7c13f · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f7c13f

Browse files
committed
[Cache] Upgrade TagAwareAdapter
1 parent 791ee7d commit 0f7c13f

File tree

4 files changed

+320
-247
lines changed

4 files changed

+320
-247
lines changed

src/Symfony/Component/Cache/Adapter/ProxyAdapter.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ static function ($key, $innerItem, $poolHash) {
8383
* @param array $item A CacheItem cast to (array); accessing protected properties requires adding the "\0*\0" PHP prefix
8484
*/
8585
static function (CacheItemInterface $innerItem, array $item) {
86-
// Tags are stored separately, no need to account for them when considering this item's newly set metadata
87-
if (isset(($metadata = $item["\0*\0newMetadata"])[CacheItem::METADATA_TAGS])) {
88-
unset($metadata[CacheItem::METADATA_TAGS]);
89-
}
90-
if ($metadata) {
86+
if ($metadata = $item["\0*\0newMetadata"]) {
9187
// For compactness, expiry and creation duration are packed in the key of an array, using magic numbers as separators
9288
$item["\0*\0value"] = ["\x9D".pack('VN', (int) (0.1 + $metadata[self::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[self::METADATA_CTIME])."\x5F" => $item["\0*\0value"]];
9389
}

0 commit comments

Comments
 (0)
0