Make RigWellPathFormations a value type

The object is immutable after construction and small, so reference
counting via cvf::Object adds nothing. Store it by value and use
std::optional where it may be absent.
This commit is contained in:
Magne Sjaastad committed 2026-10-07 13:37:23 +02:00
1 parent 07d8153852
commit 91e2e4d575
10 files changed
+47 -53

No files matched your search

@@ -533,8 +533,7 @@ void RimWellPathCollection::addWellPathFormations( const QStringList& filePaths
for ( const QString& filePath : filePaths )
{
std::map<QString, cvf::ref<RigWellPathFormations>> newFormations =
m_wellPathFormationsImporter->readWellPathFormationsFromPath( filePath );
std::map<QString, RigWellPathFormations> newFormations = m_wellPathFormationsImporter->readWellPathFormationsFromPath( filePath );
for ( const auto& newFormation : newFormations )
{
@@ -550,7 +549,7 @@ void RimWellPathCollection::addWellPathFormations( const QStringList& filePaths
}
wellPath->setFormationsGeometry( newFormation.second );
QString wellFormationsCount = QString( "%1" ).arg( newFormation.second->formationNamesCount() );
QString wellFormationsCount = QString( "%1" ).arg( newFormation.second.formationNamesCount() );
m_mostRecentlyUpdatedWellPath = wellPath;