Re: [RFC] apr_array_find()

2018-04-28 Thread Jim Jagielski
FWIW, I also agree w/ Greg's PoV regarding this. > On Apr 27, 2018, at 3:23 PM, Greg Stein wrote: > > At one point, we used to use an svn_array_find() or some such. We deprecated > it. Creating a function to do comparisons, then set up a function call... It > was just

Re: [RFC] apr_array_find()

2018-04-28 Thread William A Rowe Jr
On Sat, Apr 28, 2018 at 5:59 AM, Branko Čibej wrote: > On 27.04.2018 21:23, Greg Stein wrote: > > At one point, we used to use an svn_array_find() or some such. We > > deprecated it. Creating a function to do comparisons, then set up a > > function call... It was just annoying.

Re: [RFC] apr_array_find()

2018-04-28 Thread Branko Čibej
On 27.04.2018 21:23, Greg Stein wrote: > At one point, we used to use an svn_array_find() or some such. We > deprecated it. Creating a function to do comparisons, then set up a > function call... It was just annoying. Iteration over an APR array is > easy, and very clear. There is basically no

Re: [RFC] apr_array_find()

2018-04-27 Thread Greg Stein
At one point, we used to use an svn_array_find() or some such. We deprecated it. Creating a function to do comparisons, then set up a function call... It was just annoying. Iteration over an APR array is easy, and very clear. There is basically no code or mental overload. Using a comparator

Re: [RFC] apr_array_find()

2018-04-27 Thread William A Rowe Jr
SVN's extensions to apr largely exist here; http://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_subr/ Because they are based on apr and rooted in that ecosystem, there are a number of useful extensions in that repo that were never pushed upstream, but are not "withheld". Nobody

Re: [RFC] apr_array_find()

2018-04-27 Thread Jim Riggs
> On 27 Apr 2018, at 11:50, William A Rowe Jr wrote: > > If we code this abstractly, comparator declaration is not type-safe, but can > be declared so that it is usable by table, hash, b-tree and many other > approaches to data organization. With clever use of wrappers, we

Re: [RFC] apr_array_find()

2018-04-27 Thread Jim Riggs
> On 27 Apr 2018, at 11:44, Jim Riggs wrote: > >> Major quibble: The comparator should take a parameter that receives the >> array element size. Careful implementations will either use that size or >> check that it's the correct size. APR arrays can contain whole >> structures,

Re: [RFC] apr_array_find()

2018-04-27 Thread William A Rowe Jr
On Fri, Apr 27, 2018 at 11:44 AM, Jim Riggs wrote: > > On 27 Apr 2018, at 05:06, Branko Čibej wrote: > > > > On 27.04.2018 11:30, Nick Kew wrote: > >>> In my use cases, the search may often be strings, but not always, so I > thought that maybe APR could/should

Re: [RFC] apr_array_find()

2018-04-27 Thread Jim Riggs
> On 27 Apr 2018, at 05:06, Branko Čibej wrote: > > On 27.04.2018 11:30, Nick Kew wrote: >>> In my use cases, the search may often be strings, but not always, so I >>> thought that maybe APR could/should provide something more generic. The >>> above functions could then be

Re: [RFC] apr_array_find()

2018-04-27 Thread Branko Čibej
On 27.04.2018 11:30, Nick Kew wrote: >> On 27 Apr 2018, at 03:37, Jim Riggs wrote: >> >> I am working on some httpd changes/features/ideas and have multiple needs to >> find items in an array. In httpd, we currently have these: >> >> AP_DECLARE(int) ap_array_str_index(const

Re: [RFC] apr_array_find()

2018-04-27 Thread Nick Kew
> On 27 Apr 2018, at 03:37, Jim Riggs wrote: > > I am working on some httpd changes/features/ideas and have multiple needs to > find items in an array. In httpd, we currently have these: > > AP_DECLARE(int) ap_array_str_index(const apr_array_header_t *array, >