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

@@ -36,9 +36,9 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::readWellFormationsToGeometry( const QString& filePath )
std::map<QString, RigWellPathFormations> RifWellPathFormationReader::readWellFormationsToGeometry( const QString& filePath )
{
std::map<QString, cvf::ref<RigWellPathFormations>> result;
std::map<QString, RigWellPathFormations> result;
std::vector<QString> wellNames;
std::vector<QString> formationNames;
@@ -112,8 +112,7 @@ std::map<QString, cvf::ref<RigWellPathFormations>> RifWellPathFormationReader::r
for ( const std::pair<const QString, std::vector<RigWellPathFormation>>& formation : formations )
{
cvf::ref<RigWellPathFormations> wellPathFormations = new RigWellPathFormations( formation.second, filePath, formation.first );
result[formation.first] = wellPathFormations;
result.emplace( formation.first, RigWellPathFormations( formation.second, filePath, formation.first ) );
}
return result;