RE: svn commit: r39270 - trunk/subversion/libsvn_wc

Bert Huijben <[email protected]>
Newsgroups gmane.comp.version-control.subversion.rapidsvn.devel,gmane.comp.version-control.subversion.svn
Message-ID <001f01ca3463$a475a320$ed60e960$__37729.4764425189$1252840631$gmane$org@nl>
> -----Original Message-----
> From: Greg Stein [mailto:[email protected]]
> Sent: zondag 13 september 2009 12:57
> To: svn-lmwclWVctOZK/[email protected]
> Subject: svn commit: r39270 - trunk/subversion/libsvn_wc
> 
> Author: gstein
> Date: Sun Sep 13 03:56:34 2009
> New Revision: 39270
> 
> Log:
> Multiple minor cleanups.
> 
> * subversion/libsvn_wc/status.c:
>   (assemble_status): tighten the scope of several variables
>   (send_status_structure): constify the WB param.
>   (is_external_path): take an EXTERNALS hash, rather than the broader
>     walker baton (WB). use svn_apr_hash_index_key() for some clarity.
>   (send_unversioned_item): constify the WB param. update params to the
>     is_external_path call.
>   (handle_externals): constify the WB parameter. drop the RESULT_POOL
>     parameter since it wasn't correct thru the tortuous editor
> callbacks.
>     grab the hash's pool, and replicate the keys into that pool.
>   (get_dir_status): constify the WB param. rename POOL to SCRATCH_POOL.
>     create the ITERPOOL earlier, in order to use it as a scratch pool
> for
>     various sub-calls. use svn_hash_from_cstring_keys() rather than a
> dup
>     implementation. ignore the actual tree conflict item, and simply
>     record the path which has a conflict (ie. store "" in the hash).
> 

> @@ -950,26 +956,22 @@ get_dir_status(struct walk_status_baton
>    if (depth == svn_depth_unknown)
>      depth = svn_depth_infinity;
> 
> +  /* Make our iteration pool. */
> +  iterpool = svn_pool_create(subpool);
> +
>    /* Load list of childnodes. */
>    {
>      const apr_array_header_t *child_nodes;
> -    int i;
> 
>      SVN_ERR(svn_wc__db_read_children(&child_nodes, wb->db,
> local_abspath,
> -                                     subpool, subpool));
> -
> -    nodes = apr_hash_make(subpool);
> -    for (i = 0; i < child_nodes->nelts; i++)
> -      {
> -        const char *key = APR_ARRAY_IDX(child_nodes, i, const char*);
> -        apr_hash_set(nodes, key, APR_HASH_KEY_STRING, key);
> -      }
> +                                     iterpool, iterpool));
> +    SVN_ERR(svn_hash_from_cstring_keys(&nodes, child_nodes, subpool));
>    }

svn_hash_from_cstring_keys copies all values, this code didn't. (Was a premature optimization on my part. I knew about that function).

(In an older version of my patch there was some more processing in that loop)

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=495&dsMessageId=2394219
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.