[dev] Some diverse patches

Rick Emery rick at emery.homelinux.net
Mon Jan 5 08:29:35 PST 2004


Quoting Rick Emery <rick at emery.homelinux.net>:

> Quoting Jon Parise <jon at horde.org>:
> >
> > The introduction of sprintf() here is excessive; it's not a fast
> > function.  Please use string concatenation instead, e.g.:
> >
> >     $html .= '<i>' . _("No folders with unseen messages") . '</i>';
> >
> > --
> > Jon Parise (jon at horde.org) :: The Horde Project (http://horde.org/)
>
> I used the mnemo and kronolith summarys for comparison, and they both use
> sprintf. I'll submit patches to change them all, assuming sprintf wasn't
> used
> for a reason.

Patches attached.

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
                                              -- Leonardo Da Vinci
-------------- next part --------------
Index: summary.php
===================================================================
RCS file: /repository/kronolith/lib/Block/summary.php,v
retrieving revision 1.19
diff -u -r1.19 summary.php
--- summary.php	27 Dec 2003 14:09:28 -0000	1.19
+++ summary.php	5 Jan 2004 15:31:14 -0000
@@ -191,7 +191,7 @@
         }
 
         if (empty($htmldays)) {
-            $html .= sprintf('<i>%s</i>', _("No events to display"));
+            $html .= '<i>' .  _("No events to display") . '</i>';
         }
         return $html . '</table>';
     }
-------------- next part --------------
Index: summary.php
===================================================================
RCS file: /repository/mnemo/lib/Block/summary.php,v
retrieving revision 1.8
diff -u -r1.8 summary.php
--- summary.php	30 Dec 2003 18:52:00 -0000	1.8
+++ summary.php	5 Jan 2004 15:33:35 -0000
@@ -62,7 +62,7 @@
             $html .= "</td></tr>\n";
         }
         if (!count($memos)) {
-            $html .= sprintf('<tr><td><i>%s</i></td></tr>', _("No notes to display"));
+            $html .= '<tr><td><i>' . _("No notes to display") . '</i></td></tr>';
         }
         $html .= '</table>';
 


More information about the dev mailing list