Sérgio Basto wrote:
> On Mon, 2012-03-26 at 21:12 +0200, Daniel Shahaf wrote:
>> Sérgio Basto wrote on Mon, Mar 26, 2012 at 20:03:00 +0100:
>> > On Mon, 2012-03-26 at 20:33 +0200, Daniel Shahaf wrote:
>> > > Call svn_sort__hash() :-)
>> > Could someone write some code as example , please, I hate try to
>> > visualize .
>> > we already have a svn_sort__hash() or have to do it ?
>> The former; it's declared in svn_sorts.h.
>> The workflow I am assuming here is that you keep the data in a hash as
>> it's passed around, and then sort it at the last minute.
> And the code asked ?
> Could you paste the code that you are talking about please ?
Please try to answer your own questions before asking us. You can find lots of examples like this:
$ grep svn_sort__hash subversion/*/*.c
array = svn_sort__hash(tmpdirents, ...
So here's an example from subversion/libsvn_client/list.c:90:
/* Sort the hash, so we can call the callback in a "deterministic" order. */
array = svn_sort__hash(tmpdirents, svn_sort_compare_items_lexically, pool);
for (i = 0; i < array->nelts; ++i)
svn_sort__item_t *item = &APR_ARRAY_IDX(array, i, svn_sort__item_t);
const char *path;
svn_dirent_t *the_ent = item->value;
Received on 2012-03-27 11:44:18 CEST