mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 23:53:04 -06:00
#1926 Fishbones Export : Guard input values to std::vector::reserve()
This commit is contained in:
parent
d83c468033
commit
edd39b6ff1
@ -138,21 +138,25 @@ void RigEclipseWellLogExtractor::curveData(const RigResultAccessor* resultAccess
|
||||
std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellIntersectionInfo()
|
||||
{
|
||||
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfos;
|
||||
cellIntersectionInfos.reserve(m_intersections.size()-1);
|
||||
|
||||
for (size_t cpIdx = 0; cpIdx < m_intersections.size()-1; ++cpIdx)
|
||||
|
||||
if (m_intersections.size() > 1)
|
||||
{
|
||||
size_t cellIdx1 = m_intersectedCells[cpIdx];
|
||||
size_t cellIdx2 = m_intersectedCells[cpIdx+1];
|
||||
|
||||
if (cellIdx1 == cellIdx2)
|
||||
cellIntersectionInfos.reserve(m_intersections.size()-1);
|
||||
|
||||
for (size_t cpIdx = 0; cpIdx < m_intersections.size()-1; ++cpIdx)
|
||||
{
|
||||
cvf::Vec3d internalCellLengths;
|
||||
internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell( m_caseData->mainGrid(), cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1] );
|
||||
size_t cellIdx1 = m_intersectedCells[cpIdx];
|
||||
size_t cellIdx2 = m_intersectedCells[cpIdx+1];
|
||||
|
||||
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths));
|
||||
if (cellIdx1 == cellIdx2)
|
||||
{
|
||||
cvf::Vec3d internalCellLengths;
|
||||
internalCellLengths = RigWellPathIntersectionTools::calculateLengthInCell( m_caseData->mainGrid(), cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1] );
|
||||
|
||||
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return cellIntersectionInfos;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user