summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Orenstein <aorenste@fb.com>2017-08-17 18:27:03 -0700
committerBrad King <brad.king@kitware.com>2017-09-20 14:10:44 -0400
commitfe1e811b4fec546d8a55cd1160335766422f2127 (patch)
treeb6ff395351c45d32abc14c6df86c8119b6aa5ae8
parent95df03a1d44d48b5407dd0ddc9e618ce2f17762b (diff)
downloadcmake-fe1e811b4fec546d8a55cd1160335766422f2127.tar.gz
cmSourceFileLocation: Drop unnecessary copy-assignment operator
Update the one place that used it to avoid needing assignment.
-rw-r--r--Source/cmSourceFileLocation.cxx15
-rw-r--r--Source/cmSourceFileLocation.h6
-rw-r--r--Source/cmTarget.cxx5
3 files changed, 7 insertions, 19 deletions
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 727adeb411..4f337f246f 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -28,21 +28,6 @@ cmSourceFileLocation::cmSourceFileLocation(const cmSourceFileLocation& loc)
this->Name = loc.Name;
}
-cmSourceFileLocation& cmSourceFileLocation::operator=(
- const cmSourceFileLocation& loc)
-{
- if (this == &loc) {
- return *this;
- }
- this->Makefile = loc.Makefile;
- this->AmbiguousDirectory = loc.AmbiguousDirectory;
- this->AmbiguousExtension = loc.AmbiguousExtension;
- this->Directory = loc.Directory;
- this->Name = loc.Name;
- this->UpdateExtension(this->Name);
- return *this;
-}
-
cmSourceFileLocation::cmSourceFileLocation(cmMakefile const* mf,
const std::string& name)
: Makefile(mf)
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index 6dbc2daedb..fb5b3301d5 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -29,7 +29,6 @@ public:
cmSourceFileLocation(cmMakefile const* mf, const std::string& name);
cmSourceFileLocation();
cmSourceFileLocation(const cmSourceFileLocation& loc);
- cmSourceFileLocation& operator=(const cmSourceFileLocation& loc);
/**
* Return whether the given source file location could refers to the
@@ -79,7 +78,7 @@ public:
*/
cmMakefile const* GetMakefile() const { return this->Makefile; }
private:
- cmMakefile const* Makefile;
+ cmMakefile const* const Makefile;
bool AmbiguousDirectory;
bool AmbiguousExtension;
std::string Directory;
@@ -90,6 +89,9 @@ private:
// Update the location with additional knowledge.
void Update(cmSourceFileLocation const& loc);
void UpdateExtension(const std::string& name);
+
+ cmSourceFileLocation& operator=(const cmSourceFileLocation& loc)
+ CM_EQ_DELETE;
};
#endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c26d49a607..cb09156b96 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -592,8 +592,9 @@ public:
{
std::vector<std::string> files;
cmSystemTools::ExpandListArgument(entry, files);
- std::vector<cmSourceFileLocation> locations(files.size());
- std::transform(files.begin(), files.end(), locations.begin(),
+ std::vector<cmSourceFileLocation> locations;
+ locations.reserve(files.size());
+ std::transform(files.begin(), files.end(), std::back_inserter(locations),
CreateLocation(this->Needle.GetMakefile()));
return std::find_if(locations.begin(), locations.end(),