[dev] Some diverse patches

Rick Emery rick at emery.homelinux.net
Sun Jan 4 15:22:06 PST 2004


Quoting Jon Parise <jon at horde.org>:

> On Fri, Jan 02, 2004 at 11:55:09AM -0500, Rick Emery wrote:
>
> > Index: summary.php
> > ===================================================================
> > RCS file: /repository/imp/lib/Block/summary.php,v
> > retrieving revision 1.25
> > diff -u -r1.25 summary.php
> > --- summary.php	30 Dec 2003 18:51:58 -0000	1.25
> > +++ summary.php	2 Jan 2004 16:11:29 -0000
> > @@ -141,10 +141,12 @@
> >                  $html .= _("No folders are being checked for new mail.");
> >              } else {
> >                  if (!$anyUnseen) {
> > -                    $html .= _("No folders with unseen messages.");
> > +                    $html .= sprintf('<i>%s</i>',
> > +                        _("No folders with unseen messages"));
> >                  } else {
> >                      if ($prefs->getValue('nav_popup')) {
> > -                        $html .= _("No folders with new messages.");
> > +                        $html .= sprintf('<i>%s</i>',
> > +                            _("No folders with new messages"));
> >                      }
> >                  }
> >              }
>
> 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.

--
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



More information about the dev mailing list