diff --git a/cups/dest.c b/cups/dest.c index e4bb85b06..a69f8dc84 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -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) { /* @@ -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);