From 5018dfecdf85724f0244e3b59646b4c236fd7492 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 6 Aug 2023 14:44:15 +0200 Subject: [PATCH] Remove useless hashmap check php_libxml_unlink_entity is called from a hashmap iterator, so using xmlHashLookup to check if it comes from that hashmap will always be true. --- ext/libxml/libxml.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index a8de9bd6d65..97ceec45ddb 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -107,9 +107,7 @@ static void php_libxml_unlink_entity(void *data, void *table, const xmlChar *nam { xmlEntityPtr entity = data; if (entity->_private != NULL) { - if (xmlHashLookup(table, name) == entity) { - xmlHashRemoveEntry(table, name, NULL); - } + xmlHashRemoveEntry(table, name, NULL); } }