r23076 by jghali - Small performance improvement for TextShaper

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 13 23:14:24 UTC 2019


Author: jghali
Date: Sat Jul 13 23:14:23 2019
New Revision: 23076

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23076
Log:
Small performance improvement for TextShaper

Modified:
    trunk/Scribus/scribus/text/textshaper.cpp

Modified: trunk/Scribus/scribus/text/textshaper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23076&path=/trunk/Scribus/scribus/text/textshaper.cpp
==============================================================================
--- trunk/Scribus/scribus/text/textshaper.cpp	(original)
+++ trunk/Scribus/scribus/text/textshaper.cpp	Sat Jul 13 23:14:23 2019
@@ -174,6 +174,9 @@
 	
 	if (toPos > m_story.length() || toPos < 0)
 		toPos = m_story.length();
+
+	if (m_text.capacity() < (toPos - fromPos + 1))
+		m_text.reserve(toPos - fromPos + 1);
 	
 	for (int i = fromPos; i < toPos; ++i)
 	{




More information about the scribus-commit mailing list