From 414c6728c0bb67bd232da12034a9438ab4b08902 Mon Sep 17 00:00:00 2001 From: Ronald Brill Date: Tue, 26 Nov 2024 19:48:39 +0100 Subject: [PATCH] micro optimization --- .../org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java index 116fada645..9e68ab1296 100644 --- a/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java +++ b/src/main/java/org/htmlunit/html/parser/neko/HtmlUnitNekoDOMBuilder.java @@ -433,6 +433,10 @@ private DomNode findElementOnStack(final String... searchedElementNames) { } private static boolean isTableChild(final String nodeName) { + if (nodeName == null || nodeName.length() < 5) { + return false; + } + return "thead".equals(nodeName) || "tbody".equals(nodeName) || "tfoot".equals(nodeName)