The overlapping code in _alpm_pkghash_add() and
_alpm_pkghash_add_sorted() are now in a new static function
_alpm_pkghash_add_pkg(). This function has a third flag
parameter which determines whether the package should be added
in sorted order.
Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
---
lib/libalpm/pkghash.c | 44 ++++++++++++++------------------------------
1 files changed, 14 insertions(+), 30 deletions(-)
On Mon, Feb 7, 2011 at 5:15 PM, Pang Yan Han <pangyanhan@gmail.com> wrote:
> The overlapping code in _alpm_pkghash_add() and
> _alpm_pkghash_add_sorted() are now in a new static function
> _alpm_pkghash_add_pkg(). This function has a third flag
> parameter which determines whether the package should be added
> in sorted order.
>
> Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
> ---
> *lib/libalpm/pkghash.c | * 44 ++++++++++++++------------------------------
> *1 files changed, 14 insertions(+), 30 deletions(-)
>
> diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c
> index 5480527..233985f 100644
> --- a/lib/libalpm/pkghash.c
> +++ b/lib/libalpm/pkghash.c
> @@ -148,7 +148,7 @@ static pmpkghash_t *rehash(pmpkghash_t *oldhash)
> * * * *return(newhash);
> *}
>
> -pmpkghash_t *_alpm_pkghash_add(pmpkghash_t *hash, pmpkg_t *pkg)
> +static pmpkghash_t *_alpm_pkghash_add_pkg(pmpkghash_t *hash, pmpkg_t *pkg, int sorted)
More convention, but if it is a static function we don't use the
_alpm_ prefix. I'll fix it. And you can also wrap your commit messages
a bit longer- I think the built-in gitcommit syntax for vim sets
textwidth at 76, which makes lines never spill over in `git log`
viewing with an 80-char terminal.