Re: [xml] xmlXPathNodeSetSort performance

Stefan Behnel, 26.07.2012 16:04:
Vojtech Fried, 26.07.2012 15:45:
Keeping it in header has the advantage that it remains generic and can
be used from anywhere and with any type of parameters (e.g. not only for
sorting xmlNodePtrs). If in .c file, there can only be one sort
function. Although since the sort is used from only one place, it does
not matter :-) Another thing would be the need to move
XP_OPTIMIZED_NON_ELEM_COMPARISON to a header included both from the
sort.c and xpath.c. But that would probably be for better.

Absolutely. If we ever need it for sorting other kinds of data, we can
simply add another entry point to the source file. Everything else can just
be static and hidden in the module.

Uhm, sorry. Just ignore what I wrote here. I looked a bit closer at the
code now and that won't work.

Still, the argument that we only need it for one thing anyway is rather
striking, I'd say.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]