changeset 4646:3bfefb5042e9

Optimize Textblock::updateReference. This helps to avoid unnecessary resize calls.
author Jorge Arellano Cid <jcid@dillo.org>
date Sa, 16 Jul 2016 19:41:35 -0400
parents ab70f9ce4353
children 8c6b1b79d329
files dw/textblock.cc
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dw/textblock.cc	Sa Jul 16 18:56:16 2016 -0400
+++ b/dw/textblock.cc	Sa Jul 16 19:41:35 2016 -0400
@@ -3040,7 +3040,8 @@
 
 void Textblock::updateReference (int ref)
 {
-   queueResize (ref, false);
+   if (words->size () > 0)
+      queueResize (ref, false);
 }
 
 void Textblock::widgetRefSizeChanged (int externalIndex)