Fixed some CppCheck Performance warnings

This commit is contained in:
Jacob Støren 2017-03-03 16:23:20 +01:00
parent ba2e4ca3f2
commit b00ad4ba4a
9 changed files with 10 additions and 10 deletions

View File

@ -52,7 +52,7 @@ RifEclipseOutputFileTools::~RifEclipseOutputFileTools()
struct KeywordItemCounter
{
KeywordItemCounter(std::string keyword, size_t aggregatedItemCount)
KeywordItemCounter(const std::string& keyword, size_t aggregatedItemCount)
: m_keyword(keyword),
m_aggregatedItemCount(aggregatedItemCount),
m_reportStepCount(1)

View File

@ -36,7 +36,7 @@
class RifKeywordLocation
{
public:
RifKeywordLocation(std::string keyword, size_t itemCount, int indexWithinReportStep)
RifKeywordLocation(const std::string& keyword, size_t itemCount, int indexWithinReportStep)
: m_keyword(keyword),
m_itemCount(itemCount),
m_indexWithinReportStep(indexWithinReportStep)

View File

@ -367,7 +367,7 @@ std::map<std::string, std::vector<std::string> > RigFemPartResultsCollection::sc
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert)
RigFemScalarResultFrames* RigFemPartResultsCollection::calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string& fieldNameToConvert)
{
caf::ProgressInfo frameCountProgress(this->frameCount() * 2, "");
frameCountProgress.setProgressDescription("Calculating " + QString::fromStdString(convertedResultAddr.fieldName + ": " + convertedResultAddr.componentName));

View File

@ -86,7 +86,7 @@ private:
RigFemScalarResultFrames * dstDataFrames,
caf::ProgressInfo* frameCountProgress);
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string fieldNameToConvert);
RigFemScalarResultFrames* calculateBarConvertedResult(int partIndex, const RigFemResultAddress &convertedResultAddr, const std::string& fieldNameToConvert);
RigFemScalarResultFrames* calculateEnIpPorBarResult(int partIndex, const RigFemResultAddress &convertedResultAddr);
RigFemScalarResultFrames* calculateTimeLapseResult(int partIndex, const RigFemResultAddress& resVarAddr);
RigFemScalarResultFrames* calculateMeanStressSEM(int partIndex, const RigFemResultAddress& resVarAddr);

View File

@ -38,8 +38,9 @@
///
//--------------------------------------------------------------------------------------------------
RigGeoMechCaseData::RigGeoMechCaseData(const std::string& fileName)
: m_geoMechCaseFileName(fileName)
{
m_geoMechCaseFileName = fileName;
}
//--------------------------------------------------------------------------------------------------

View File

@ -696,7 +696,7 @@ std::map<std::string, std::vector<std::string> > RifOdbReader::fieldAndComponent
std::map<std::string, std::vector<std::string> > fieldsAndComponents;
std::map< RifOdbResultKey, std::vector<std::string> >::const_iterator resMapIt;
for (resMapIt = m_resultsMetaData.begin(); resMapIt != m_resultsMetaData.end(); resMapIt++)
for (resMapIt = m_resultsMetaData.begin(); resMapIt != m_resultsMetaData.end(); ++resMapIt)
{
if (resMapIt->first.resultPostion == position)
{

View File

@ -52,7 +52,7 @@ size_t RigEclCellIndexCalculator::resultCellIndex(size_t gridIndex, size_t gridC
RigAccWellFlowCalculator::RigAccWellFlowCalculator(const std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
const std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds,
const std::map<QString, const std::vector<double>* >& tracerCellFractionValues,
const RigEclCellIndexCalculator cellIndexCalculator,
const RigEclCellIndexCalculator& cellIndexCalculator,
double smallContribThreshold,
bool isProducer)
: m_pipeBranchesCLCoords(pipeBranchesCLCoords),

View File

@ -59,7 +59,7 @@ public:
RigAccWellFlowCalculator(const std::vector< std::vector <cvf::Vec3d> >& pipeBranchesCLCoords,
const std::vector< std::vector <RigWellResultPoint> >& pipeBranchesCellIds,
const std::map<QString, const std::vector<double>* >& tracerCellFractionValues,
const RigEclCellIndexCalculator cellIndexCalculator,
const RigEclCellIndexCalculator& cellIndexCalculator,
double smallContribThreshold,
bool isProducer);

View File

@ -24,9 +24,8 @@
///
//--------------------------------------------------------------------------------------------------
RigSimulationWellCoordsAndMD::RigSimulationWellCoordsAndMD(const std::vector<cvf::Vec3d>& wellPathPoints)
: m_wellPathPoints(wellPathPoints)
{
m_wellPathPoints = wellPathPoints;
computeMeasuredDepths();
}