summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceFile.cxx
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2014-02-09 02:35:52 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2014-04-29 01:43:39 (GMT)
commit10baf00f3d14124ee97ca12510595501d66ed70e (patch)
treeb12c416c4ae485eae2e35c2e7c33daa06ebdebba /Source/cmSourceFile.cxx
parent14e7a8ae1c8be09a58156d71b185e2b98d378a07 (diff)
downloadCMake-10baf00f3d14124ee97ca12510595501d66ed70e.zip
CMake-10baf00f3d14124ee97ca12510595501d66ed70e.tar.gz
CMake-10baf00f3d14124ee97ca12510595501d66ed70e.tar.bz2
cmSourceFile: Cache the isUiFile check
The filename extension call is expensive, so cache the .ui check.
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r--Source/cmSourceFile.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 0ab30a2..3b130ec 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -24,6 +24,8 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name):
this->CustomCommand = 0;
this->Properties.SetCMakeInstance(mf->GetCMakeInstance());
this->FindFullPathFailed = false;
+ this->IsUiFile = ("ui" ==
+ cmSystemTools::GetFilenameLastExtension(this->Location.GetName()));
}
//----------------------------------------------------------------------------
@@ -297,9 +299,7 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
- std::string ext =
- cmSystemTools::GetFilenameLastExtension(this->Location.GetName());
- if (ext == ".ui")
+ if (this->IsUiFile)
{
cmMakefile const* mf = this->Location.GetMakefile();
if (prop == "AUTOUIC_OPTIONS")