You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/03/03 15:29:36 UTC

svn commit: r1296629 - /subversion/trunk/subversion/svn/list-cmd.c

Author: stefan2
Date: Sat Mar  3 14:29:36 2012
New Revision: 1296629

URL: http://svn.apache.org/viewvc?rev=1296629&view=rev
Log:
Minor client-side speedup of svn ls.

* subversion/svn/list-cmd.c
  (print_dirent): fetch localized strings only once.

Modified:
    subversion/trunk/subversion/svn/list-cmd.c

Modified: subversion/trunk/subversion/svn/list-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/list-cmd.c?rev=1296629&r1=1296628&r2=1296629&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/list-cmd.c (original)
+++ subversion/trunk/subversion/svn/list-cmd.c Sat Mar  3 14:29:36 2012
@@ -56,6 +56,13 @@ print_dirent(void *baton,
 {
   struct print_baton *pb = baton;
   const char *entryname;
+  static const char *time_format_long = NULL;
+  static const char *time_format_short = NULL;
+
+  if (time_format_long == NULL)
+    time_format_long = _("%b %d %H:%M");
+  if (time_format_short == NULL)
+    time_format_short = _("%b %d  %Y");
 
   if (pb->ctx->cancel_func)
     SVN_ERR(pb->ctx->cancel_func(pb->ctx->cancel_baton));
@@ -90,12 +97,12 @@ print_dirent(void *baton,
           && apr_time_sec(dirent->time - now) < (365 * 86400 / 2))
         {
           apr_err = apr_strftime(timestr, &size, sizeof(timestr),
-                                 _("%b %d %H:%M"), &exp_time);
+                                 time_format_long, &exp_time);
         }
       else
         {
           apr_err = apr_strftime(timestr, &size, sizeof(timestr),
-                                 _("%b %d  %Y"), &exp_time);
+                                 time_format_short, &exp_time);
         }
 
       /* if that failed, just zero out the string and print nothing */