[Koha-bugs] [Bug 15968] Unnecessary loop in C4::Templates

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 3 17:29:42 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15968

Frédéric Demians <frederic at tamil.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #48617|0                           |1
        is obsolete|                            |

--- Comment #2 from Frédéric Demians <frederic at tamil.fr> ---
Created attachment 48633
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=48633&action=edit
Bug 15968: Unnecessary loop in C4::Templates

>From C4::Templates::output

     # add variables set via param to $vars for processing
     for my $k ( keys %{ $self->{VARS} } ) {
         $vars->{$k} = $self->{VARS}->{$k};
     }

This loop is not necessary, we could do the same with

     $vars = { %$vars, %{ $self->{VARS} } };

After a quick benchmark, it gains 100 microseconds when we pass 170 vars
to the template.

Test plan:
Do some clicks on the interface, everything should be ok.

Signed-off-by: Frédéric Demians <f.demians at tamil.fr>
  Perl idiosyncratic way of merging hash, clearer, if not quicker (not
  verified)

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list