perf improvement

This commit is contained in:
Ken Martin 2003-06-05 15:28:51 -04:00
parent adbb5c5e79
commit 5c217cf83f

View File

@ -1655,8 +1655,8 @@ cmSourceFile* cmMakefile::GetSource(const char* sourceName) const
for(std::vector<cmSourceFile*>::const_iterator i = m_SourceFiles.begin(); for(std::vector<cmSourceFile*>::const_iterator i = m_SourceFiles.begin();
i != m_SourceFiles.end(); ++i) i != m_SourceFiles.end(); ++i)
{ {
if (cmSystemTools::GetFilenamePath((*i)->GetFullPath()) == path && if ((*i)->GetSourceName() == sname &&
(*i)->GetSourceName() == sname && cmSystemTools::GetFilenamePath((*i)->GetFullPath()) == path &&
(ext.size() == 0 || (ext == (*i)->GetSourceExtension()))) (ext.size() == 0 || (ext == (*i)->GetSourceExtension())))
{ {
return *i; return *i;