Replace 'foo.size() == 0' pattern with foo.empty().
This commit is contained in:
parent
0e14c7ee63
commit
524610f967
@ -49,7 +49,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
// TODO: Fix nsis to force out file name
|
// TODO: Fix nsis to force out file name
|
||||||
|
|
||||||
std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
|
std::string nsisInFileName = this->FindTemplate("NSIS.template.in");
|
||||||
if ( nsisInFileName.size() == 0 )
|
if (nsisInFileName.empty())
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"CPack error: Could not find NSIS installer template file."
|
"CPack error: Could not find NSIS installer template file."
|
||||||
@ -58,7 +58,7 @@ int cmCPackNSISGenerator::PackageFiles()
|
|||||||
}
|
}
|
||||||
std::string nsisInInstallOptions
|
std::string nsisInInstallOptions
|
||||||
= this->FindTemplate("NSIS.InstallOptions.ini.in");
|
= this->FindTemplate("NSIS.InstallOptions.ini.in");
|
||||||
if ( nsisInInstallOptions.size() == 0 )
|
if (nsisInInstallOptions.empty())
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
cmCPackLogger(cmCPackLog::LOG_ERROR,
|
||||||
"CPack error: Could not find NSIS installer options file."
|
"CPack error: Could not find NSIS installer options file."
|
||||||
|
@ -255,7 +255,7 @@ void cmGlobalVisualStudio6Generator
|
|||||||
::OutputDSWFile(cmLocalGenerator* root,
|
::OutputDSWFile(cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators)
|
std::vector<cmLocalGenerator*>& generators)
|
||||||
{
|
{
|
||||||
if(generators.size() == 0)
|
if(generators.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ cmGlobalVisualStudio71Generator
|
|||||||
{
|
{
|
||||||
const char* name = di->c_str();
|
const char* name = di->c_str();
|
||||||
std::string guid = this->GetGUID(name);
|
std::string guid = this->GetGUID(name);
|
||||||
if(guid.size() == 0)
|
if(guid.empty())
|
||||||
{
|
{
|
||||||
std::string m = "Target: ";
|
std::string m = "Target: ";
|
||||||
m += target.GetName();
|
m += target.GetName();
|
||||||
|
@ -359,7 +359,7 @@ void cmGlobalVisualStudio7Generator
|
|||||||
::OutputSLNFile(cmLocalGenerator* root,
|
::OutputSLNFile(cmLocalGenerator* root,
|
||||||
std::vector<cmLocalGenerator*>& generators)
|
std::vector<cmLocalGenerator*>& generators)
|
||||||
{
|
{
|
||||||
if(generators.size() == 0)
|
if(generators.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ cmGlobalVisualStudio7Generator
|
|||||||
{
|
{
|
||||||
const char* name = di->c_str();
|
const char* name = di->c_str();
|
||||||
std::string guid = this->GetGUID(name);
|
std::string guid = this->GetGUID(name);
|
||||||
if(guid.size() == 0)
|
if(guid.empty())
|
||||||
{
|
{
|
||||||
std::string m = "Target: ";
|
std::string m = "Target: ";
|
||||||
m += target.GetName();
|
m += target.GetName();
|
||||||
|
@ -988,7 +988,7 @@ void cmLocalVisualStudio6Generator
|
|||||||
{
|
{
|
||||||
std::string lpath =
|
std::string lpath =
|
||||||
this->ConvertToOutputFormat(libPath.c_str(), SHELL);
|
this->ConvertToOutputFormat(libPath.c_str(), SHELL);
|
||||||
if(lpath.size() == 0)
|
if(lpath.empty())
|
||||||
{
|
{
|
||||||
lpath = ".";
|
lpath = ".";
|
||||||
}
|
}
|
||||||
@ -1021,7 +1021,7 @@ void cmLocalVisualStudio6Generator
|
|||||||
{
|
{
|
||||||
std::string lpath =
|
std::string lpath =
|
||||||
this->ConvertToOutputFormat(exePath.c_str(), SHELL);
|
this->ConvertToOutputFormat(exePath.c_str(), SHELL);
|
||||||
if(lpath.size() == 0)
|
if(lpath.empty())
|
||||||
{
|
{
|
||||||
lpath = ".";
|
lpath = ".";
|
||||||
}
|
}
|
||||||
@ -1062,7 +1062,7 @@ void cmLocalVisualStudio6Generator
|
|||||||
}
|
}
|
||||||
std::string lpath =
|
std::string lpath =
|
||||||
this->ConvertToOutputFormat(path.c_str(), SHELL);
|
this->ConvertToOutputFormat(path.c_str(), SHELL);
|
||||||
if(lpath.size() == 0)
|
if(lpath.empty())
|
||||||
{
|
{
|
||||||
lpath = ".";
|
lpath = ".";
|
||||||
}
|
}
|
||||||
|
@ -2331,7 +2331,7 @@ void cmLocalVisualStudio7Generator::ReadAndStoreExternalGUID(
|
|||||||
cmVS7XMLParser parser;
|
cmVS7XMLParser parser;
|
||||||
parser.ParseFile(path);
|
parser.ParseFile(path);
|
||||||
// if we can not find a GUID then we will generate one later
|
// if we can not find a GUID then we will generate one later
|
||||||
if(parser.GUID.size() == 0)
|
if(parser.GUID.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2783,7 +2783,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
|
|||||||
std::vector<cmCustomCommand> const& commands,
|
std::vector<cmCustomCommand> const& commands,
|
||||||
std::string const& configName)
|
std::string const& configName)
|
||||||
{
|
{
|
||||||
if(commands.size() == 0)
|
if(commands.empty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ cmXCode21Object::cmXCode21Object(PBXType ptype, Type type)
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmXCode21Object::PrintComment(std::ostream& out)
|
void cmXCode21Object::PrintComment(std::ostream& out)
|
||||||
{
|
{
|
||||||
if(this->Comment.size() == 0)
|
if(this->Comment.empty())
|
||||||
{
|
{
|
||||||
cmXCodeObject* n = this->GetObject("name");
|
cmXCodeObject* n = this->GetObject("name");
|
||||||
if(n)
|
if(n)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user