aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/modelinglib
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-01-15 19:10:34 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2020-01-20 20:56:57 +0000
commit24a25eed1481a7c563431d79e3ad07840c0f7125 (patch)
tree3eb8a56dac620a31e6af362bf7c03201ea645771 /src/libs/modelinglib
parentad4040972b9d763b2ceaa7444d18e65dd3da2ee9 (diff)
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/modelinglib')
-rw-r--r--src/libs/modelinglib/qmt/infrastructure/qcompressedfile.cpp2
-rw-r--r--src/libs/modelinglib/qmt/stereotype/iconshape.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.cpp b/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.cpp
index 7853ad2341e..98caf695417 100644
--- a/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.cpp
+++ b/src/libs/modelinglib/qmt/infrastructure/qcompressedfile.cpp
@@ -105,7 +105,7 @@ qint64 QCompressedDevice::writeData(const char *data, qint64 len)
qint64 QCompressedDevice::flush()
{
- if (openMode() == QIODevice::WriteOnly && m_buffer.size() > 0) {
+ if (openMode() == QIODevice::WriteOnly && !m_buffer.isEmpty()) {
QMT_ASSERT(m_targetDevice->isOpen(), return 0);
QMT_ASSERT(m_targetDevice->openMode() == QIODevice::WriteOnly, return 0);
QByteArray compressedBuffer = qCompress(m_buffer);
diff --git a/src/libs/modelinglib/qmt/stereotype/iconshape.cpp b/src/libs/modelinglib/qmt/stereotype/iconshape.cpp
index f138684b64e..172bb369841 100644
--- a/src/libs/modelinglib/qmt/stereotype/iconshape.cpp
+++ b/src/libs/modelinglib/qmt/stereotype/iconshape.cpp
@@ -76,7 +76,7 @@ public:
PathShape *IconShape::IconShapePrivate::activePath()
{
PathShape *pathShape = nullptr;
- if (m_shapes.count() > 0)
+ if (!m_shapes.isEmpty())
pathShape = dynamic_cast<PathShape *>(m_shapes.last());
if (!pathShape) {
pathShape = new PathShape();