From ea1fd31a3d41352b024fb35a1a781dce6a2f7afe Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 9 Sep 2017 21:30:39 +0100 Subject: [PATCH] icalparse.y: Remove else-block that returns by merging if-conditions. The code tested two values to see if they were present, and if they were, and were equal, then it returned this node. If either were missing then this node was still returned because it matched the more limited criteria that had already been tested. So the test for returning this node can more simply be if either value to compare is missing, or they're (both present and) equal. --- sbr/icalparse.y | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sbr/icalparse.y b/sbr/icalparse.y index 88edb0c8..f2fcc0ea 100644 --- a/sbr/icalparse.y +++ b/sbr/icalparse.y @@ -176,13 +176,8 @@ find_contentline (contentline *contentlines, const char *name, for (node = contentlines; node; node = node->next) { /* node->name will be NULL if the line was "deleted". */ if (node->name && ! strcasecmp (name, node->name)) { - if (val && node->value) { - if (! strcasecmp (val, node->value)) { - return node; - } - } else { + if (!val || !node->value || !strcasecmp(val, node->value)) return node; - } } } -- 2.56.0