summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2018-11-06 17:21:34 -0500
committerJason Woodward2018-11-06 17:21:34 -0500
commitbaa6fff0c032017ec95ba59b1fcef75153f677b8 (patch)
tree9a6216409d1402523e3dd6a3d5348e66ed3ac595
parent64fe69d3d35de543f48f5c31cbf22710e6fade63 (diff)
downloadslapt-get-baa6fff0c032017ec95ba59b1fcef75153f677b8.tar.gz
tweak dependency loop index temporary
-rw-r--r--src/package.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/package.c b/src/package.c
index 6f92e8b..a77881f 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1279,7 +1279,6 @@ int slapt_get_pkg_dependencies(const slapt_rc_config *global_config,
slapt_pkg_err_list_t *conflict_err,
slapt_pkg_err_list_t *missing_err)
{
- uint32_t i = 0;
slapt_list_t *dep_parts = NULL;
/* don't go any further if the required member is empty or disable_dep_check is set */
@@ -1343,17 +1342,17 @@ int slapt_get_pkg_dependencies(const slapt_rc_config *global_config,
} else {
/* now move the package to the end after it's dependencies */
slapt_pkg_info_t *tmp = NULL;
+ uint32_t dep_idx = 0;
- i = 0;
- while (i < deps->pkg_count) {
- if (strcmp(deps->pkgs[i]->name, tmp_pkg->name) == 0 && tmp == NULL)
- tmp = deps->pkgs[i];
+ while (dep_idx < deps->pkg_count) {
+ if (strcmp(deps->pkgs[dep_idx]->name, tmp_pkg->name) == 0 && tmp == NULL)
+ tmp = deps->pkgs[dep_idx];
/* move all subsequent packages up */
- if (tmp != NULL && (i + 1 < deps->pkg_count))
- deps->pkgs[i] = deps->pkgs[i + 1];
+ if (tmp != NULL && (dep_idx + 1 < deps->pkg_count))
+ deps->pkgs[dep_idx] = deps->pkgs[dep_idx + 1];
- ++i;
+ ++dep_idx;
}
/*