Skip to content

Commit

Permalink
AbstractTag: add cached instance of the config, to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 6, 2024
1 parent 3a472d5 commit b0536cf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Liquid/AbstractTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ abstract class AbstractTag
*/
protected $attributes = array();

/**
* A cached instance of the config array, for performance reasons.
*
* @var array
*/
protected $config = array();

/**
* Constructor.
*
Expand All @@ -48,6 +55,8 @@ public function __construct($markup, array &$tokens, FileSystem $fileSystem = nu
{
$this->markup = $markup;
$this->fileSystem = $fileSystem;
$this->config = &Liquid::$config;

$this->parse($tokens);
}

Expand Down

0 comments on commit b0536cf

Please sign in to comment.