From ca2fdeb640e88f11c3e36a8bf52b77e7081238c0 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 27 Jun 2002 21:17:25 -0400 Subject: performance inprovements --- Source/cmMakefile.cxx | 14 +++++++++++--- Source/cmSourceFile.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8506de9..4841584 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1209,6 +1209,12 @@ cmMakefile::FindSourceGroup(const char* source, bool cmMakefile::IsFunctionBlocked(const char *name, std::vector const&args) { + // if there are no blockers get out of here + if (m_FunctionBlockers.begin() == m_FunctionBlockers.end()) + { + return false; + } + // loop over all function blockers to see if any block this command std::set::const_iterator pos; std::vector expandedArguments = args; @@ -1334,10 +1340,12 @@ cmSourceFile* cmMakefile::GetSource(const char* sourceName) const for(std::vector::const_iterator i = m_SourceFiles.begin(); i != m_SourceFiles.end(); ++i) { - if((*i)->GetSourceName() == s - && (ext.size() == 0 || (ext == (*i)->GetSourceExtension()))) + if ((*i)->GetSourceNameReference() == s) { - return *i; + if ((ext.size() == 0 || (ext == (*i)->GetSourceExtension()))) + { + return *i; + } } } return 0; diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h index 0f975c0..3e41eaa 100644 --- a/Source/cmSourceFile.h +++ b/Source/cmSourceFile.h @@ -92,6 +92,7 @@ public: * (In most cases this is the name of the class.) */ std::string GetSourceName() const {return m_SourceName;} + const std::string &GetSourceNameReference() const {return m_SourceName;} void SetSourceName(const char *name) {m_SourceName = name;} /** -- cgit v0.12