[pacman-dev] [PATCH] generalize alpm_list_find_str

Aaron Griffin aaronmgriffin at gmail.com
Fri Nov 16 12:20:22 EST 2007


On Nov 16, 2007 11:14 AM, Xavier <shiningxc at gmail.com> wrote:
> On Fri, Nov 16, 2007 at 05:41:03PM +0100, Nagy Gabor wrote:
> > From 06d48a8bd7b5ada59b4e8daad58f6eb6b40de4e7 Mon Sep 17 00:00:00 2001
> > From: Nagy Gabor <ngaba at bibl.u-szeged.hu>
> > Date: Fri, 16 Nov 2007 17:25:23 +0100
> > Subject: [PATCH] generalize alpm_list_find_str
> >
> > This patch renames alpm_list_find_str to alpm_list_find and adds a new "comparison function" parameter to it.
> > The old alpm_list_find is renamed to alpm_list_find_ptr.
> >
>
> Since its generally strcmp which is used, why not having, besides your
> generic alpm_list_find, an alpm_list_find_str, which would just call
> alpm_list_find with strcmp ?
> It looks annoying to have to add that casted strmcp argument every time.

I agree. In fact, I was even going to suggest doing the same with the
find_ptr version, just for clarity and less duplicate code.




More information about the pacman-dev mailing list