subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmpil...@apache.org
Subject svn commit: r1130682 - /subversion/trunk/subversion/libsvn_ra_serf/blncache.c
Date Thu, 02 Jun 2011 17:41:09 GMT
Author: cmpilato
Date: Thu Jun  2 17:41:08 2011
New Revision: 1130682

URL: http://svn.apache.org/viewvc?rev=1130682&view=rev
Log:
* subversion/libsvn_ra_serf/blncache.c
  (recycle_cache_if_needed): Rework to avoid an intermediate variable.

Modified:
    subversion/trunk/subversion/libsvn_ra_serf/blncache.c

Modified: subversion/trunk/subversion/libsvn_ra_serf/blncache.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/blncache.c?rev=1130682&r1=1130681&r2=1130682&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/blncache.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/blncache.c Thu Jun  2 17:41:08 2011
@@ -105,12 +105,8 @@ hash_set_copy(apr_hash_t *hash,
 static void
 recycle_cache_if_needed(svn_ra_serf__blncache_t *blncache)
 {
-  apr_size_t cache_size = 0;
-
-  cache_size += apr_hash_count(blncache->baseline_info);
-  cache_size += apr_hash_count(blncache->revnum_to_bc);
-
-  if (cache_size > MAX_CACHE_SIZE)
+  if (MAX_CACHE_SIZE < (apr_hash_count(blncache->baseline_info)
+                        + apr_hash_count(blncache->revnum_to_bc)))
   {
     /* Clear cache pool and create new hash tables. */
     apr_pool_t *cache_pool = apr_hash_pool_get(blncache->revnum_to_bc);



Mime
View raw message