summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-16 19:26:45 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-16 19:26:45 (EST)
commit1140e120000d84abed1ce0392f689eaa61d8ad59 (patch)
treeca1a15919daaf88d8729386ab7101be598a91fa1 /libopkg
parent4a5627af1ecf0061c99409f4a3b4e84de5e58f30 (diff)
remove some unnecessary code from pkg_vec_insert
git-svn-id: http://opkg.googlecode.com/svn/trunk@182 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/pkg_hash.c1
-rw-r--r--libopkg/pkg_vec.c13
2 files changed, 6 insertions, 8 deletions
diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
index d6a062d..aaa6974 100644
--- a/libopkg/pkg_hash.c
+++ b/libopkg/pkg_hash.c
@@ -203,6 +203,7 @@ pkg_t *pkg_hash_fetch_best_installation_candidate(opkg_conf_t *conf, abstract_pk
for (i = 0; i < nprovides; i++) {
abstract_pkg_t *provider_apkg = provided_apkgs[i];
opkg_message(conf, OPKG_DEBUG, " adding %s to providers\n", provider_apkg->name);
+ printf(" adding %s to providers\n", provider_apkg->name);
abstract_pkg_vec_insert(providers, provider_apkg);
}
nprovides = providers->len;
diff --git a/libopkg/pkg_vec.c b/libopkg/pkg_vec.c
index 819a135..84b9799 100644
--- a/libopkg/pkg_vec.c
+++ b/libopkg/pkg_vec.c
@@ -104,16 +104,13 @@ pkg_t *pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status,opkg_conf
}
}
+int pkg_vec_insert_called=0;
void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg)
{
- int found = 0;
-
- /* we didn't find one, add it */
- if(!found){
- vec->pkgs = (pkg_t **)realloc(vec->pkgs, (vec->len + 1) * sizeof(pkg_t *));
- *(const pkg_t **)&vec->pkgs[vec->len] = pkg;
- vec->len++;
- }
+ vec->pkgs = (pkg_t **)realloc(vec->pkgs, (vec->len + 1) * sizeof(pkg_t *));
+ pkg_vec_insert_called++;
+ *(const pkg_t **)&vec->pkgs[vec->len] = pkg;
+ vec->len++;
}
int pkg_vec_contains(pkg_vec_t *vec, pkg_t *apkg)