Janitor : Use const ref when possible

This commit is contained in:
Magne Sjaastad 2019-11-03 12:19:24 +01:00
parent 93f6bc8c72
commit b46124efd7
19 changed files with 64 additions and 62 deletions

View File

@ -53,7 +53,9 @@ void RiaImageFileCompare::reset()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaImageFileCompare::runComparison( QString imgFileName, QString refFileName, QString diffFileName )
bool RiaImageFileCompare::runComparison( const QString& imgFileName,
const QString& refFileName,
const QString& diffFileName )
{
reset();

View File

@ -39,7 +39,7 @@ public:
explicit RiaImageFileCompare( QString compareExecutable );
~RiaImageFileCompare();
bool runComparison( QString imgFileName, QString refFileName, QString diffFileName );
bool runComparison( const QString& imgFileName, const QString& refFileName, const QString& diffFileName );
bool imagesEqual() const;
ErrorType error() const;
QString errorMessage() const;

View File

@ -110,7 +110,7 @@ void RicfCommandFileExecutor::executeCommands( QTextStream& stream )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfCommandFileExecutor::setExportPath( ExportType type, QString path )
void RicfCommandFileExecutor::setExportPath( ExportType type, const QString& path )
{
m_exportPaths[type] = path;
}

View File

@ -53,7 +53,7 @@ public:
~RicfCommandFileExecutor();
void executeCommands( QTextStream& stream );
void setExportPath( ExportType type, QString path );
void setExportPath( ExportType type, const QString& path );
QString getExportPath( ExportType type ) const;
void setLastProjectPath( const QString& path );
QString getLastProjectPath() const;

View File

@ -47,7 +47,7 @@
struct WellBorePartForTransCalc
{
WellBorePartForTransCalc(
cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, QString metaData )
cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, const QString& metaData )
: lengthsInCell( lengthsInCell )
, wellRadius( wellRadius )
, skinFactor( skinFactor )

View File

@ -126,8 +126,8 @@ void RicWellPathFractureReportItem::setUnitSystem( RiaEclipseUnitTools::UnitSyst
///
//--------------------------------------------------------------------------------------------------
void RicWellPathFractureReportItem::setPressureDepletionParameters( bool performPDDScaling,
QString timeStepString,
QString wbhpString,
const QString& timeStepString,
const QString& wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,

View File

@ -39,8 +39,8 @@ public:
void setAreaWeightedPermeability( double permeability );
void setUnitSystem( RiaEclipseUnitTools::UnitSystem unitSystem );
void setPressureDepletionParameters( bool performPressureDepletionScaling,
QString timeStepString,
QString wbhpString,
const QString& timeStepString,
const QString& wbhpString,
double userWBHP,
double actualWBHP,
double minPressureDrop,

View File

@ -724,7 +724,7 @@ std::vector<RigCompletionDataGridCell>
std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
RicExportLgrFeature::cellsIntersectingCompletions_PerCompletion(
RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*> wellPaths,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs )

View File

@ -232,7 +232,7 @@ private:
static std::map<CompletionInfo, std::vector<RigCompletionDataGridCell>>
cellsIntersectingCompletions_PerCompletion( RimEclipseCase* eclipseCase,
const std::vector<RimWellPath*> wellPaths,
const std::vector<RimWellPath*>& wellPaths,
size_t timeStep,
const std::set<RigCompletionData::CompletionType>& completionTypes,
QStringList* wellsIntersectingOtherLgrs );

View File

@ -208,7 +208,7 @@ bool RicImportSummaryCasesFeature::createSummaryCasesFromFiles( const QStringLis
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummaryCase*> cases )
void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummaryCase*>& cases )
{
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
@ -223,7 +223,7 @@ void RicImportSummaryCasesFeature::addSummaryCases( const std::vector<RimSummary
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*> cases )
void RicImportSummaryCasesFeature::addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*>& cases )
{
std::vector<RimSummaryCaseCollection*> selectedColl = caf::selectedObjectsByTypeStrict<RimSummaryCaseCollection*>();

View File

@ -44,8 +44,8 @@ public:
static bool createSummaryCasesFromFiles( const QStringList& fileName,
std::vector<RimSummaryCase*>* newCases,
bool ensembleOrGroup = false );
static void addSummaryCases( const std::vector<RimSummaryCase*> cases );
static void addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*> cases );
static void addSummaryCases( const std::vector<RimSummaryCase*>& cases );
static void addCasesToGroupIfRelevant( const std::vector<RimSummaryCase*>& cases );
static QStringList runRecursiveSummaryCaseFileSearchDialog( const QString& dialogTitle, const QString& pathCacheName );

View File

@ -145,8 +145,8 @@ public:
RicSummaryCaseRestartDialogResult( Status _status,
RicSummaryCaseRestartDialog::ImportOptions _summaryImportOption,
RicSummaryCaseRestartDialog::ImportOptions _gridImportOption,
QStringList _summaryFiles,
QStringList _gridFiles,
const QStringList& _summaryFiles,
const QStringList& _gridFiles,
bool _applyToAll )
: status( _status )
, summaryImportOption( _summaryImportOption )

View File

@ -286,7 +286,7 @@ std::set<QDateTime>
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderEclipseRft::availableTimeSteps(
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
if ( !m_ecl_rft_file )
{

View File

@ -50,7 +50,7 @@ public:
std::set<QDateTime> availableTimeSteps( const QString& wellName ) override;
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;

View File

@ -132,7 +132,7 @@ std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps(
///
//--------------------------------------------------------------------------------------------------
std::set<QDateTime> RifReaderEnsembleStatisticsRft::availableTimeSteps(
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
const QString& wellName, const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
std::set<QDateTime> allTimeSteps;
for ( auto summaryCase : m_summaryCaseCollection->allSummaryCases() )

View File

@ -37,7 +37,7 @@ public:
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<RifEclipseRftAddress::RftWellLogChannelType> availableWellLogChannels( const QString& wellName ) override;
std::set<QString> wellNames() override;

View File

@ -340,7 +340,7 @@ std::set<QDateTime> RifReaderFmuRft::availableTimeSteps( const QString& wellName
//--------------------------------------------------------------------------------------------------
std::set<QDateTime>
RifReaderFmuRft::availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels )
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels )
{
if ( relevantChannels.count( RifEclipseRftAddress::TVD ) || relevantChannels.count( RifEclipseRftAddress::MD ) ||
relevantChannels.count( RifEclipseRftAddress::PRESSURE ) )

View File

@ -76,7 +76,7 @@ public:
std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) override;
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName ) override;
std::set<QDateTime> availableTimeSteps( const QString& wellName,
const RifEclipseRftAddress::RftWellLogChannelType& wellLogChannelName ) override;

View File

@ -35,7 +35,7 @@ public:
virtual std::set<QDateTime>
availableTimeSteps( const QString& wellName,
const std::set<RifEclipseRftAddress::RftWellLogChannelType> relevantChannels ) = 0;
const std::set<RifEclipseRftAddress::RftWellLogChannelType>& relevantChannels ) = 0;
virtual std::set<QDateTime> availableTimeSteps( const QString& wellName ) = 0;
virtual std::set<QDateTime>
availableTimeSteps( const QString& wellName,