Skip to content

Commit

Permalink
Remove redundant checks
Browse files Browse the repository at this point in the history
These checks just do extra work and have no effect

My justification:
https://godbolt.org/z/bP6GzzMza
  • Loading branch information
AreaZR committed Feb 3, 2023
1 parent a6d91a2 commit 16a8f18
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
3 changes: 1 addition & 2 deletions backend/usb-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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("");
Expand Down
2 changes: 1 addition & 1 deletion cups/tls-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion cups/tls-sspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ httpCredentialsString(
if (!buffer)
return (0);

if (buffer && bufsize > 0)
if (bufsize > 0)
*buffer = '\0';

cert = http_sspi_create_credential(first);
Expand Down
5 changes: 2 additions & 3 deletions filter/rastertoepson.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion scheduler/type.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16a8f18

Please sign in to comment.