r24780 by jghali - Small performance optimization

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 15 23:23:56 UTC 2021


Author: jghali
Date: Wed Dec 15 23:23:55 2021
New Revision: 24780

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24780
Log:
Small performance optimization

Modified:
    trunk/Scribus/scribus/util_text.cpp

Modified: trunk/Scribus/scribus/util_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24780&path=/trunk/Scribus/scribus/util_text.cpp
==============================================================================
--- trunk/Scribus/scribus/util_text.cpp	(original)
+++ trunk/Scribus/scribus/util_text.cpp	Wed Dec 15 23:23:55 2021
@@ -28,10 +28,11 @@
 	//qDebug() << QString("looking up %1/ %2").arg(parStyle.name()).arg(parStyle.alignment()); 
 	if (named)
 	{
-		for (int i=0; i < doc->paragraphStyles().count(); ++i)
+		const auto& paragraphStyles = doc->paragraphStyles();
+		for (int i=0; i < paragraphStyles.count(); ++i)
 		{
 			//qDebug() << QString("%1 %2").arg(i).arg(doc->paragraphStyles()[i].name());
-			if (parStyle.name() == doc->paragraphStyles()[i].name()) {
+			if (parStyle.name() == paragraphStyles[i].name()) {
 				return i;
 			}
 		}




More information about the scribus-commit mailing list