Reduce the scope of temporary cmProp variables and other improvements

This commit is contained in:
Vitaly Stakhovsky
2020-11-05 11:00:00 -05:00
parent c43b0505a5
commit f6e7d5f3a0
12 changed files with 39 additions and 49 deletions
+2 -4
View File
@@ -583,14 +583,12 @@ const char* CCONV cmSourceFileGetProperty(void* arg, const char* prop)
{
cmCPluginAPISourceFile* sf = static_cast<cmCPluginAPISourceFile*>(arg);
if (cmSourceFile* rsf = sf->RealSourceFile) {
cmProp p = rsf->GetProperty(prop);
return cmToCStr(p);
return cmToCStr(rsf->GetProperty(prop));
}
if (!strcmp(prop, "LOCATION")) {
return sf->FullPath.c_str();
}
cmProp retVal = sf->Properties.GetPropertyValue(prop);
return cmToCStr(retVal);
return cmToCStr(sf->Properties.GetPropertyValue(prop));
}
int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)