]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Remove redundant checks 609/head
authorRose <83477269+AtariDreams@users.noreply.github.com>
Fri, 3 Feb 2023 15:55:17 +0000 (10:55 -0500)
committerRose <83477269+AtariDreams@users.noreply.github.com>
Fri, 3 Feb 2023 15:55:17 +0000 (10:55 -0500)
These checks just do extra work and have no effect

My justification:
https://godbolt.org/z/bP6GzzMza

backend/usb-darwin.c
cups/tls-darwin.c
cups/tls-sspi.c
filter/rastertoepson.c
scheduler/type.c

index a4140508281c9482f9355a3b983d0967bf3f2292..a4cd25dcb7133dcff59982cb18d030231e9e1c05 100644 (file)
@@ -1809,8 +1809,7 @@ static CFStringRef copy_printer_interface_indexed_description(printer_interface_
        if (description[1] != kUSBStringDesc)
                return NULL;
 
-       if ((description[0] & 1) != 0)
-               description[0] &= ~1;
+       description[0] &= ~1;
 
        if (description[0] < 2)
                return CFSTR("");
index 869e94db9d14dff740e5fb03b6c3bbb52190ec63..002236a3b10a32217aa7f7d968edd0699ea44fb7 100644 (file)
@@ -793,7 +793,7 @@ httpCredentialsString(
   if (!buffer)
     return (0);
 
-  if (buffer && bufsize > 0)
+  if (bufsize > 0)
     *buffer = '\0';
 
   if ((first = (http_credential_t *)cupsArrayFirst(credentials)) != NULL &&
index 14f1a084a14a58bdc801cc4d201405b56d79fa1c..f925122f279734a41712a9f0da4adbbb09094709 100644 (file)
@@ -324,7 +324,7 @@ httpCredentialsString(
   if (!buffer)
     return (0);
 
-  if (buffer && bufsize > 0)
+  if (bufsize > 0)
     *buffer = '\0';
 
   cert = http_sspi_create_credential(first);
index c815691dc71e247b1a47025005b9c0fc167a4265..b9cfa548e949b452f28e6e45c1d7492a267edfc7 100644 (file)
@@ -462,11 +462,10 @@ CompressData(const unsigned char *line,   /* I - Data to compress */
       *comp_ptr++ = temp;
 
      /*
-      * Check the last bit in the current byte and the first bit in the
-      * next byte...
+      * Check the last bit in the current byte...
       */
 
-      if ((temp & 0x01) && comp_ptr < line_end && *comp_ptr & 0x80)
+      if ((temp & 0x01) && comp_ptr < line_end)
         *comp_ptr &= 0x7f;
     }
   }
index 731514c07f02116f9872ffa53a9c41f61e50d7f4..c6c531022bd16f66dece416c064a19b001007f8d 100644 (file)
@@ -221,7 +221,7 @@ mimeAddTypeRule(mime_type_t *mt,    /* I - Type to add to */
     else if (*rule == '+' && current != NULL)
     {
       if (logic != MIME_MAGIC_AND &&
-          current != NULL && current->prev != NULL)
+          current->prev != NULL)
       {
        /*
         * OK, we have more than 1 rule in the current tree level...  Make a