Commit 73f648f1 authored by Daniel Pfeifer's avatar Daniel Pfeifer

use empty method to check for emptyness

parent 6e06a53e
......@@ -14,7 +14,7 @@
bool cmAddCompileOptionsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -18,7 +18,7 @@
bool cmAddCustomTargetCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -16,7 +16,7 @@ bool cmAddDefinitionsCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
// it is OK to have no arguments
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -18,7 +18,7 @@
bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmAddSubDirectoryCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -27,7 +27,7 @@ bool cmBuildCommand::InitialPass(std::vector<std::string> const& args,
bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("requires at least one argument naming a CMake variable");
return false;
}
......
......@@ -22,7 +22,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args,
"The build_name command should not be called; see CMP0036.")) {
return true;
}
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -17,7 +17,7 @@
bool cmCMakePolicyCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("requires at least one argument.");
return false;
}
......
......@@ -85,7 +85,7 @@ bool cmConditionEvaluator::IsTrue(
errorString = "";
// handle empty invocation
if (args.size() < 1) {
if (args.empty()) {
return false;
}
......
......@@ -17,7 +17,7 @@
bool cmDefinePropertyCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -17,7 +17,7 @@ bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
{
bool optional = false;
std::vector<std::string> languages;
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -19,7 +19,7 @@
bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -31,7 +31,7 @@ void cmExecuteProcessCommandAppend(std::vector<char>& output, const char* data,
bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -69,7 +69,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
const ImportPropertyMap& properties)
{
std::string config = "";
if (this->Configurations.size()) {
if (!this->Configurations.empty()) {
config = this->Configurations[0];
}
cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
......
......@@ -76,7 +76,7 @@ void cmExportInstallAndroidMKGenerator::GenerateImportTargetCode(
os << "LOCAL_SRC_FILES := $(_IMPORT_PREFIX)/";
os << target->Target->GetProperty("__dest") << "/";
std::string config = "";
if (this->Configurations.size()) {
if (!this->Configurations.empty()) {
config = this->Configurations[0];
}
os << target->GetFullName(config) << "\n";
......@@ -103,7 +103,7 @@ void cmExportInstallAndroidMKGenerator::GenerateInterfaceProperties(
const ImportPropertyMap& properties)
{
std::string config = "";
if (this->Configurations.size()) {
if (!this->Configurations.empty()) {
config = this->Configurations[0];
}
cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
......
......@@ -27,7 +27,7 @@ bool cmExportLibraryDependenciesCommand::InitialPass(
"see CMP0033.")) {
return true;
}
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -89,7 +89,7 @@ void cmFindPackageCommand::AppendSearchPathGroups()
bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -113,7 +113,7 @@ bool cmForEachFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -202,7 +202,7 @@ bool cmFunctionFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
bool cmFunctionCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1 || args.size() > 4) {
if (args.empty() || args.size() > 4) {
this->SetError("called with wrong number of arguments. "
"include() only takes one file.");
return false;
......
......@@ -15,7 +15,7 @@
bool cmIncludeDirectoryCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -15,7 +15,7 @@
bool cmIncludeRegularExpressionCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if ((args.size() < 1) || (args.size() > 2)) {
if ((args.empty()) || (args.size() > 2)) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmLinkDirectoriesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -15,7 +15,7 @@
bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
return true;
}
// add libraries, nothe that there is an optional prefix
......
......@@ -167,10 +167,10 @@ public:
iterator Truncate()
{
assert(this->UpPositions.size() > 0);
assert(!this->UpPositions.empty());
this->UpPositions.erase(this->UpPositions.begin() + 1,
this->UpPositions.end());
assert(this->Data.size() > 0);
assert(!this->Data.empty());
this->Data.erase(this->Data.begin() + 1, this->Data.end());
return iterator(this, 1);
}
......
......@@ -18,7 +18,7 @@
bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with wrong number of arguments.");
}
......
......@@ -183,7 +183,7 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& args,
"The load_command command should not be called; see CMP0031.")) {
return true;
}
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -236,7 +236,7 @@ bool cmMacroFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
bool cmMacroCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -16,7 +16,7 @@
bool cmMathCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("must be called with at least one argument.");
return false;
}
......
......@@ -17,7 +17,7 @@
bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("PROJECT called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmRemoveCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -16,7 +16,7 @@ bool cmRemoveDefinitionsCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
// it is OK to have no arguments
if (args.size() < 1) {
if (args.empty()) {
return true;
}
......
......@@ -15,7 +15,7 @@
bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -17,7 +17,7 @@
bool cmSetDirectoryPropertiesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -18,7 +18,7 @@
bool cmSetTestsPropertiesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -26,7 +26,7 @@
bool cmStringCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("must be called with at least one argument.");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -22,7 +22,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
std::vector<std::string> const& args, cmExecutionStatus&)
{
// must have one argument
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -15,7 +15,7 @@
bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1 || args.size() > 2) {
if (args.empty() || args.size() > 2) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
......@@ -104,7 +104,7 @@ cmVariableWatchCommand::~cmVariableWatchCommand()
bool cmVariableWatchCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("must be called with at least one argument.");
return false;
}
......
......@@ -133,7 +133,7 @@ bool cmWhileFunctionBlocker::ShouldRemove(const cmListFileFunction& lff,
bool cmWhileCommand::InvokeInitialPass(
const std::vector<cmListFileArgument>& args, cmExecutionStatus&)
{
if (args.size() < 1) {
if (args.empty()) {
this->SetError("called with incorrect number of arguments");
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment