Make the type parameter of pkgreq_by_pkgbase() optional

This simplifies the code a bit, improves maintainability and reduces the
number of SQL queries when deleting a package.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-05-21 17:08:58 +02:00
parent c3614c4f09
commit 01bfae82ce
2 changed files with 7 additions and 7 deletions

View file

@ -513,10 +513,7 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via, $grant=false) {
if (!$action) {
$username = username_from_sid($_COOKIE['AURSID']);
foreach ($base_ids as $base_id) {
$pkgreq_ids = array_merge(
pkgreq_by_pkgbase($base_id, 'deletion'),
pkgreq_by_pkgbase($base_id, 'merge'),
pkgreq_by_pkgbase($base_id, 'orphan'));
$pkgreq_ids = array_merge(pkgreq_by_pkgbase($base_id));
foreach ($pkgreq_ids as $pkgreq_id) {
pkgreq_close(intval($pkgreq_id), 'accepted',
'The user ' . $username .