Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14958

Twig extension function lang() performs redundant template data copying

    XMLWordPrintable

    Details

      Description

      In \phpbb\template\twig\extension.php, function lang() performs full template data and then a part ofit ('rootref') copying in https://github.com/phpbb/phpbb/blob/3.1.x/phpBB/phpbb/template/twig/extension.php#L172-L173

      		$context = $this->context->get_data_ref();
      		$context_vars = $context['.'][0];
      

      In respect of optimization, this can be shortened to

      $context_vars = $this->context->get_root_ref();
      

      (the latter also returns a referense).

        Attachments

          Activity

            People

            Assignee:
            Marc Marc
            Reporter:
            rxu rxu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: