From 3fea520aa33fb6cf5771c27b481864c54489fce7 Mon Sep 17 00:00:00 2001 From: poire-z Date: Sun, 5 Jul 2020 18:16:41 +0200 Subject: [PATCH] initNodeStyle(): skip some possibly costly validation --- crengine/src/lvtinydom.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crengine/src/lvtinydom.cpp b/crengine/src/lvtinydom.cpp index 31d2d5327..ecef3a376 100644 --- a/crengine/src/lvtinydom.cpp +++ b/crengine/src/lvtinydom.cpp @@ -16124,11 +16124,16 @@ void ldomNode::initNodeStyle() { ldomNode * parent = getParentNode(); + /* This has never triggered over the years, so trust we don't need it. + * This might also improves quite a bit TXT documents handling (where the main + * nodes may have tens of thousands of
 children, one for each line
+             * of the text file.
+             *
             // DEBUG TEST
             if ( parent->getChildIndex( getDataIndex() )<0 ) {
                 CRLog::error("Invalid parent->child relation for nodes %d->%d", parent->getDataIndex(), getDataIndex() );
             }
-
+            */
 
             //lvdomElementFormatRec * parent_fmt = node->getParentNode()->getRenderData();
             css_style_ref_t style = parent->getStyle();