FreeBSD/contrib/subversion/subversion/libsvn_subr/skel.c
/* Return an estimate of the number of bytes that the external
   representation of SKEL will occupy.  Since reallocing is expensive
   in pools, it's worth trying to get the buffer size right the first
   time.  */
Return an estimate of the number of bytes that the external
representation of SKEL will occupy.  Since reallocing is expensive
in pools, it's worth trying to get the buffer size right the first
time.
Return an estimate of the number of bytes that the external representation of SKEL will occupy . Since reallocing is expensive in pools it ' s worth trying to get the buffer size right the first time .
static apr_size_t
estimate_unparsed_size(const svn_skel_t *skel)
{
  if (skel->is_atom)
    {
      if (skel->len < 100)
        return skel->len + 3;
      else
        return skel->len + 30;
    }
  else
    {
      apr_size_t total_len;
      svn_skel_t *child;
      total_len = 2;
      for (child = skel->children; child; child = child->next)
        total_len += estimate_unparsed_size(child) + 1;
      return total_len;
    }
}
static apr_size_t estimate_unparsed_size ( const svn_skel_t * skel ) { if ( skel -> is_atom ) { if ( skel -> len < 100 ) return skel -> len + 3 ; else return skel -> len + 30 ; } else { apr_size_t total_len ; svn_skel_t * child ; total_len = 2 ; for ( child = skel -> children ; child ; child = child -> next ) total_len += estimate_unparsed_size ( child ) + 1 ; return total_len ; } }
Return an estimate of the number of bytes that the external
representation of SKEL will occupy.
Return an estimate of the number of bytes that the external representation of SKEL will occupy .
/* If we have to use the explicit-length form, that'll be
           two bytes for the length, one byte for the space, and
           the contents.  */ /* Allow space for opening and closing parens, and a space
         between each pair of elements.  */