[pacman-dev] [PATCH] generalize alpm_list_find_str
Hi! Patch attached. Bye, ngaba ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
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@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.
On Nov 16, 2007 11:14 AM, Xavier <shiningxc@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@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.
Attached. Bye, ngaba ---------------------------------------------------- SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu This mail sent through IMP: http://horde.org/imp/
On Nov 16, 2007 4:19 PM, Nagy Gabor <ngaba@bibl.u-szeged.hu> wrote:
Attached.
Looks better to me - Dan, I'll let you be gatekeeper here, but I like this.
participants (3)
-
Aaron Griffin
-
Nagy Gabor
-
Xavier