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