From fa037776264a9ae554ed4e0a25f4e9f11f570524 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 15 Sep 2012 20:46:51 +0200 Subject: [PATCH] Do not populate SourceEntries in AddSourceFile. It only generates a default constructed SourceEntry for each cmSourceFile. this->Internal->SourceEntries[sf]; in cmTargetTraceDependencies::Trace has the same effect, and is called early in generation-time for each source file anyway. --- Source/cmTarget.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0c9e8f0e9..5ef63a3e4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -799,12 +799,10 @@ std::vector const& cmTarget::GetSourceFiles() void cmTarget::AddSourceFile(cmSourceFile* sf) { typedef cmTargetInternals::SourceEntriesType SourceEntriesType; - SourceEntriesType::iterator i = this->Internal->SourceEntries.find(sf); - if(i == this->Internal->SourceEntries.end()) + if (std::find(this->SourceFiles.begin(), this->SourceFiles.end(), sf) + == this->SourceFiles.end()) { typedef cmTargetInternals::SourceEntry SourceEntry; - SourceEntriesType::value_type entry(sf, SourceEntry()); - i = this->Internal->SourceEntries.insert(entry).first; this->SourceFiles.push_back(sf); } }