lib/package_fulldeptree.c: simplify.
This commit is contained in:
		| @@ -124,7 +124,6 @@ ordered_depends(struct xbps_handle *xhp, xbps_dictionary_t pkgd, bool rpool) | |||||||
| 	struct item *item, *xitem; | 	struct item *item, *xitem; | ||||||
| 	const char *pkgver; | 	const char *pkgver; | ||||||
| 	char *pkgn; | 	char *pkgn; | ||||||
| 	bool fdup = false; |  | ||||||
|  |  | ||||||
| 	assert(xhp); | 	assert(xhp); | ||||||
| 	assert(pkgd); | 	assert(pkgd); | ||||||
| @@ -188,16 +187,7 @@ ordered_depends(struct xbps_handle *xhp, xbps_dictionary_t pkgd, bool rpool) | |||||||
| 		free(curdepname); | 		free(curdepname); | ||||||
| 	} | 	} | ||||||
| 	/* all deps were processed, add item to head */ | 	/* all deps were processed, add item to head */ | ||||||
| 	for (unsigned int i = 0; i < xbps_array_count(result); i++) { | 	if (!xbps_match_string_in_array(result, item->pkgver)) { | ||||||
| 		const char *pkgdep; |  | ||||||
|  |  | ||||||
| 		xbps_array_get_cstring_nocopy(result, i, &pkgdep); |  | ||||||
| 		if (strcmp(item->pkgver, pkgdep) == 0) { |  | ||||||
| 			fdup = true; |  | ||||||
| 			break; |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 	if (!fdup) { |  | ||||||
| 		str = xbps_string_create_cstring(item->pkgver); | 		str = xbps_string_create_cstring(item->pkgver); | ||||||
| 		assert(str); | 		assert(str); | ||||||
| 		xbps_array_add_first(result, str); | 		xbps_array_add_first(result, str); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user