#1926 Fishbones Export : Guard input values to std::vector::reserve()

This commit is contained in:
Magne Sjaastad 2017-09-22 13:10:09 +02:00
parent d83c468033
commit edd39b6ff1

View File

@ -138,6 +138,9 @@ void RigEclipseWellLogExtractor::curveData(const RigResultAccessor* resultAccess
std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellIntersectionInfo()
{
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfos;
if (m_intersections.size() > 1)
{
cellIntersectionInfos.reserve(m_intersections.size()-1);
for (size_t cpIdx = 0; cpIdx < m_intersections.size()-1; ++cpIdx)
@ -153,6 +156,7 @@ std::vector<WellPathCellIntersectionInfo> RigEclipseWellLogExtractor::cellInters
cellIntersectionInfos.push_back(WellPathCellIntersectionInfo(cellIdx1, m_intersections[cpIdx], m_intersections[cpIdx+1], internalCellLengths));
}
}
}
return cellIntersectionInfos;
}