[Koha-bugs] [Bug 29859] Favor iterators over as_list
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Feb 3 15:30:44 CET 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29859
--- Comment #5 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 130102
--> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130102
Bug 29859: Use iterator instead of as_list
Review of attachment 130102:
--> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=29859&attachment=130102)
-----------------------------------------------------------------
We introduce a few .count calls in templates here.. which will add a DB hit per
call unless I'm mistaken?
Now, I don't think a count call has much impact on performance, but it may be
worth taking into consideration at some point.. for the pattern [% IF
whatevers.count %]boiler[% FOREACH whatever IN whatever %]list of stuff[% END
%][% END %] we could perhaps just add the boiler in the first iteration of the
loop using the 'first' or 'index' methods of the TT iterator? instead of
testing for count explicitly?
::: Koha/Holds.pm
@@ +122,5 @@
> + {
> + columns => ['itemnumber'],
> + collapse => 1,
> + }
> + )->get_columns('itemnumber');
get_column vs get_columns
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list