Skip to content

Commit

Permalink
Merge pull request #5281 from simnandez/develop
Browse files Browse the repository at this point in the history
Fix better perfomance in for
  • Loading branch information
eldy committed Jun 4, 2016
2 parents 054329c + baa6dd8 commit 1dd9e37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions htdocs/admin/receiptprinter.php
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -377,7 +378,8 @@ function gzdecode($data)
if ($ret > 0) {
setEventMessages($printer->error, $printer->errors, 'errors');
} else {
for ($line=0; $line < count($printer->listprinterstemplates); $line++) {
$max = count($printer->listprinterstemplates);
for ($line=0; $line < $max; $line++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) {
Expand Down Expand Up @@ -422,7 +424,8 @@ function gzdecode($data)
print '<th>'.$langs->trans("Tag").'</th>';
print '<th>'.$langs->trans("Description").'</th>';
print "</tr>\n";
for ($tag=0; $tag < count($printer->tags); $tag++) {
$max = count($printer->tags);
for ($tag=0; $tag < $max; $tag++) {
$var = !$var;
print '<tr '.$bc[$var].'>';
print '<td>&lt;'.$printer->tags[$tag].'&gt;</td><td>'.$langs->trans(strtoupper($printer->tags[$tag])).'</td>';
Expand Down

0 comments on commit 1dd9e37

Please sign in to comment.