From: Michael Tremer Date: Sat, 11 Jan 2025 14:26:36 +0000 (+0000) Subject: parser: Simplify declaration matching X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8a9b38112dc61b21885a4b9de151cbc9fcaf2064;p=people%2Fric9%2Fpakfire.git parser: Simplify declaration matching Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/parser.c b/src/pakfire/parser.c index 31dd8cebe..3198202e5 100644 --- a/src/pakfire/parser.c +++ b/src/pakfire/parser.c @@ -195,14 +195,19 @@ static struct pakfire_parser_declaration* pakfire_parser_get_declaration( if (!d) break; - // Return if namespace and name match - if ((strcmp(d->namespace, namespace) == 0) && (strcmp(d->name, name) == 0)) { + // Skip if namespace does not match + if (!pakfire_string_equals(d->namespace, namespace)) + continue; + + // Skip if name does not match + else if (!pakfire_string_equals(d->name, name)) + continue; + #ifdef PAKFIRE_DEBUG_PARSER - DEBUG(parser->ctx, "%p: Found result = %s\n", parser, d->value); + DEBUG(parser->ctx, "%p: Found result = %s\n", parser, d->value); #endif /* PAKFIRE_DEBUG_PARSER */ - return d; - } + return d; } #ifdef PAKFIRE_DEBUG_PARSER