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 2015/01/05 20:06:25 UTC

svn commit: r1649613 - /subversion/trunk/subversion/libsvn_subr/cache.c

Author: stefan2
Date: Mon Jan  5 19:06:24 2015
New Revision: 1649613

URL: http://svn.apache.org/r1649613
Log:
Fix cache usage stats printing code.

* subversion/libsvn_subr/cache.c
  (svn_cache__format_info): Actually skip the leading empty buckets
                            in the histogram as intended.

Modified:
    subversion/trunk/subversion/libsvn_subr/cache.c

Modified: subversion/trunk/subversion/libsvn_subr/cache.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/cache.c?rev=1649613&r1=1649612&r2=1649613&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/cache.c (original)
+++ subversion/trunk/subversion/libsvn_subr/cache.c Mon Jan  5 19:06:24 2015
@@ -259,15 +259,15 @@ svn_cache__format_info(const svn_cache__
 
       int i;
       int count = sizeof(info->histogram) / sizeof(info->histogram[0]);
-      for (i = 0; i < count; ++i)
+      for (i = count - 1; i >= 0; --i)
         if (info->histogram[i] > 0 || text->len > 0)
           text = svn_stringbuf_createf(result_pool,
                                        i == count - 1
-                                         ? "%12" APR_UINT64_T_FMT
-                                           " buckets with >%d entries\n%s"
-                                         : "%12" APR_UINT64_T_FMT
-                                           " buckets with %d entries\n%s",
-                                        info->histogram[i], i, text->data);
+                                         ? "%s%12" APR_UINT64_T_FMT
+                                           " buckets with >%d entries\n"
+                                         : "%s%12" APR_UINT64_T_FMT
+                                           " buckets with %d entries\n",
+                                       text->data, info->histogram[i], i);
 
       histogram = text->data;
     }