summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksandr Koval <oleksandr.koval.dev@gmail.com>2020-09-04 00:17:32 +0300
committerOleksandr Koval <oleksandr.koval.dev@gmail.com>2020-09-04 00:17:32 +0300
commit879bd7fd9c84fa72001632818fce43339d755e3b (patch)
tree7353020ca6f4fb86a793fe4ab70a100fce460c1b
parentca5babfd7a1da8e32f927ad086fdd91c2b09853b (diff)
downloadcmake-879bd7fd9c84fa72001632818fce43339d755e3b.tar.gz
cmStateSnapshot: Return const reference from GetExecutionListFile()
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmStateSnapshot.cxx2
-rw-r--r--Source/cmStateSnapshot.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f384e211bd..3e95caa858 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3347,7 +3347,7 @@ bool cmMakefile::IsLoopBlock() const
return !this->LoopBlockCounter.empty() && this->LoopBlockCounter.top() > 0;
}
-std::string cmMakefile::GetExecutionFilePath() const
+std::string const& cmMakefile::GetExecutionFilePath() const
{
assert(this->StateSnapshot.IsValid());
return this->StateSnapshot.GetExecutionListFile();
@@ -3357,8 +3357,8 @@ bool cmMakefile::ExpandArguments(std::vector<cmListFileArgument> const& inArgs,
std::vector<std::string>& outArgs,
const char* filename) const
{
- std::string efp = this->GetExecutionFilePath();
if (!filename) {
+ auto const& efp = this->GetExecutionFilePath();
filename = efp.c_str();
}
std::string value;
@@ -3389,8 +3389,8 @@ bool cmMakefile::ExpandArguments(
std::vector<cmListFileArgument> const& inArgs,
std::vector<cmExpandedCommandArgument>& outArgs, const char* filename) const
{
- std::string efp = this->GetExecutionFilePath();
if (!filename) {
+ auto const& efp = this->GetExecutionFilePath();
filename = efp.c_str();
}
std::string value;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 350f59da7d..fe9e78e57c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -943,7 +943,7 @@ public:
const char* GetDefineFlagsCMP0059() const;
- std::string GetExecutionFilePath() const;
+ std::string const& GetExecutionFilePath() const;
void EnforceDirectoryLevelRules() const;
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index bf8e331b7c..ddd2222a71 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -53,7 +53,7 @@ void cmStateSnapshot::SetListFile(const std::string& listfile)
*this->Position->ExecutionListFile = listfile;
}
-std::string cmStateSnapshot::GetExecutionListFile() const
+std::string const& cmStateSnapshot::GetExecutionListFile() const
{
return *this->Position->ExecutionListFile;
}
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index c19f174859..36d6d3d6c1 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -33,7 +33,7 @@ public:
void SetListFile(std::string const& listfile);
- std::string GetExecutionListFile() const;
+ std::string const& GetExecutionListFile() const;
std::vector<cmStateSnapshot> GetChildren();