summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
877ea64)
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.
for (node = contentlines; node; node = node->next) {
/* node->name will be NULL if the line was "deleted". */
if (node->name && ! strcasecmp (name, node->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))