r24183 by craig - Avoid potential QMap member detachment using constFind/End

scribus-commit scribus-commit at lists.scribus.net
Thu Nov 5 22:54:08 UTC 2020


Author: craig
Date: Thu Nov  5 22:54:07 2020
New Revision: 24183

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24183
Log:
Avoid potential QMap member detachment using constFind/End

Modified:
    trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp

Modified: trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24183&path=/trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolorprofilecache.cpp	Thu Nov  5 22:54:07 2020
@@ -12,8 +12,8 @@
 	if (path.isEmpty())
 		return;
 
-	auto iter = m_profileMap.find(path);
-	if (iter != m_profileMap.end())
+	auto iter = m_profileMap.constFind(path);
+	if (iter != m_profileMap.constEnd())
 	{
 		QSharedPointer<ScColorProfileData> strongRef = iter.value().toStrongRef();
 		if (strongRef) return;
@@ -34,8 +34,8 @@
 	
 bool ScColorProfileCache::contains(const QString& profilePath)
 {
-	auto iter = m_profileMap.find(profilePath);
-	if (iter != m_profileMap.end())
+	auto iter = m_profileMap.constFind(profilePath);
+	if (iter != m_profileMap.constEnd())
 	{
 		QSharedPointer<ScColorProfileData> strongRef = iter.value().toStrongRef();
 		return (!strongRef.isNull());
@@ -46,8 +46,8 @@
 ScColorProfile ScColorProfileCache::profile(const QString& profilePath)
 {
 	ScColorProfile profile;
-	auto iter = m_profileMap.find(profilePath);
-	if (iter != m_profileMap.end())
+	auto iter = m_profileMap.constFind(profilePath);
+	if (iter != m_profileMap.constEnd())
 		profile = ScColorProfile(iter.value());
 	return profile;
-}
+}




More information about the scribus-commit mailing list