Skip to content

Commit

Permalink
Apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zdohnal committed Dec 19, 2024
1 parent 3e05eee commit 042591c
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions cups/dest.c
Original file line number Diff line number Diff line change
Expand Up @@ -3521,10 +3521,6 @@ cups_get_cb(_cups_getdata_t *data, // I - Data from cupsGetDests
unsigned flags, // I - Enumeration flags
cups_dest_t *dest) // I - Destination
{
int diff = 1, // Result of comparison
match; // Matching index


if (flags & CUPS_DEST_FLAGS_REMOVED)
{
/*
Expand All @@ -3533,17 +3529,13 @@ cups_get_cb(_cups_getdata_t *data, // I - Data from cupsGetDests

data->num_dests = cupsRemoveDest(dest->name, dest->instance, data->num_dests, &data->dests);
}
else
else if (!cupsGetDest(dest->name, dest->instance, data->num_dests, data->dests))
{
/*
* Add destination to array if not present already...
* Add destination to array if not already present...
*/

if (data->num_dests)
match = cups_find_dest(dest->name, dest->instance, data->num_dests, data->dests, -1, &diff);

if (diff)
data->num_dests = cupsCopyDest(dest, data->num_dests, &data->dests);
data->num_dests = cupsCopyDest(dest, data->num_dests, &data->dests);
}

return (1);
Expand Down

0 comments on commit 042591c

Please sign in to comment.