From 83a1e4fee39321358858841069e1fe36d44edefc Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 2 Sep 2011 19:26:07 -0500 Subject: Clean up handling of size fields We currently have csize, isize, and size concepts, and sometimes the difference isn't clear. Ensure the following holds: * size (aka csize): always the compressed size of the package; available for everything except local packages (where it will return 0) * isize: always the installed size of the package; available for all three package types Signed-off-by: Dan McGee --- lib/libalpm/delta.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/delta.c') diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index c88955f7..1dd2bf44 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -249,12 +249,11 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(alpm_pkg_t *pkg) { - off_t pkgsize = alpm_pkg_get_size(pkg); - alpm_list_t *unused = find_unused( + ASSERT(pkg != NULL, return NULL); + return find_unused( alpm_pkg_get_deltas(pkg), alpm_pkg_get_filename(pkg), - pkgsize * MAX_DELTA_RATIO); - return unused; + pkg->size * MAX_DELTA_RATIO); } /** @} */ -- cgit v1.2.3-54-g00ecf