diff options
author | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-11-23 02:16:19 +0900 |
---|---|---|
committer | Ivan Komissarov <ABBAPOH@gmail.com> | 2019-11-25 18:14:47 +0000 |
commit | 2e417555d0c993811f6db4e3f93cd2a3b9f250aa (patch) | |
tree | 305cde2266db120381c7069a554b68ce460c65e7 | |
parent | 4eb26770f04380c14e771053a3e04273b31f6b20 (diff) | |
download | qbs-2e417555d0c993811f6db4e3f93cd2a3b9f250aa.tar.gz |
Apply 'readability-container-size-empty' fix-it
Change-Id: I4693b9a2c941b63e8b60bbe5d188031e648354f6
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | examples/protobuf/cpp/main.cpp | 2 | ||||
-rw-r--r-- | src/app/qbs/commandlinefrontend.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/language/moduleloader.cpp | 2 | ||||
-rw-r--r-- | src/shared/json/json.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/protobuf/cpp/main.cpp b/examples/protobuf/cpp/main.cpp index 703a9d302..8d2ca9763 100644 --- a/examples/protobuf/cpp/main.cpp +++ b/examples/protobuf/cpp/main.cpp @@ -96,7 +96,7 @@ void listPeople(const tutorial::AddressBook& address_book) std::cout << "Person ID: " << person.id() << std::endl; std::cout << " Name: " << person.name() << std::endl; - if (person.email() != "") { + if (!person.email().empty()) { std::cout << " E-mail address: " << person.email() << std::endl; } diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp index 8be06f3af..f204602a6 100644 --- a/src/app/qbs/commandlinefrontend.cpp +++ b/src/app/qbs/commandlinefrontend.cpp @@ -653,7 +653,7 @@ ProductData CommandLineFrontend::getTheOneRunnableProduct() } QBS_CHECK(false); } - QBS_CHECK(m_parser.products().size() == 0); + QBS_CHECK(m_parser.products().isEmpty()); QList<ProductData> runnableProducts; const auto products = m_projects.front().projectData().allProducts(); diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp index 9c8f9da1d..5568febbd 100644 --- a/src/lib/corelib/language/moduleloader.cpp +++ b/src/lib/corelib/language/moduleloader.cpp @@ -1964,7 +1964,7 @@ bool ModuleLoader::mergeExportItems(const ProductContext &productContext) productContext.project->topLevelProject->productModules.insert(productContext.name, pmi); if (hasDependenciesOnProductType) m_exportsWithDeferredDependsItems.insert(merged); - return exportItems.size() > 0; + return !exportItems.empty(); } Item *ModuleLoader::loadItemFromFile(const QString &filePath, diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp index 3a838a177..4ff52fe62 100644 --- a/src/shared/json/json.cpp +++ b/src/shared/json/json.cpp @@ -4127,7 +4127,7 @@ bool Parser::parseObject() DEBUG << "numEntries" << parsedObject.offsets.size(); int table = objectOffset; // finalize the object - if (parsedObject.offsets.size()) { + if (!parsedObject.offsets.empty()) { int tableSize = static_cast<int>(parsedObject.offsets.size()) * sizeof(uint32_t); table = reserveSpace(tableSize); memcpy(data + table, &*parsedObject.offsets.begin(), tableSize); @@ -4218,7 +4218,7 @@ bool Parser::parseArray() DEBUG << "size =" << values.size(); int table = arrayOffset; // finalize the object - if (values.size()) { + if (!values.empty()) { int tableSize = static_cast<int>(values.size() * sizeof(Value)); table = reserveSpace(tableSize); memcpy(data + table, values.data(), tableSize); |