Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit dc851cf2 authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization. Initialize variables

parent 3a10bdfa
......@@ -32,9 +32,6 @@ class Q_DECL_HIDDEN CollectionStatistics::Private : public QSharedData
public:
Private()
: QSharedData()
, count(-1)
, unreadCount(-1)
, size(-1)
{
}
......@@ -46,9 +43,9 @@ public:
size = other.size;
}
qint64 count;
qint64 unreadCount;
qint64 size;
qint64 count = -1;
qint64 unreadCount = -1;
qint64 size = -1;
};
CollectionStatistics::CollectionStatistics()
......
......@@ -366,7 +366,7 @@ public:
if (localCollection.contentMimeTypes().size() != remoteCollection.contentMimeTypes().size()) {
return true;
} else {
for (int i = 0; i < remoteCollection.contentMimeTypes().size(); i++) {
for (int i = 0, total = remoteCollection.contentMimeTypes().size(); i < total; ++i) {
const QString &m = remoteCollection.contentMimeTypes().at(i);
if (!localCollection.contentMimeTypes().contains(m)) {
return true;
......
......@@ -20,9 +20,6 @@
#include "conflicthandler_p.h"
//KF5 PORT ME
//#include "conflictresolvedialog_p.h"
#include "itemcreatejob.h"
#include "itemfetchjob.h"
#include "itemfetchscope.h"
......
......@@ -54,9 +54,6 @@ public:
Private(Control *parent)
: mParent(parent)
, mEventLoop(nullptr)
, mSuccess(false)
, mStarting(false)
, mStopping(false)
{
}
......@@ -73,10 +70,10 @@ public:
QPointer<Control> mParent;
QEventLoop *mEventLoop = nullptr;
bool mSuccess;
bool mSuccess = false;
bool mStarting;
bool mStopping;
bool mStarting = false;
bool mStopping = false;
};
bool Control::Private::exec()
......
......@@ -91,6 +91,7 @@ EntityDisplayAttribute *EntityDisplayAttribute::clone() const
QByteArray EntityDisplayAttribute::serialized() const
{
QList<QByteArray> l;
l.reserve(4);
l << ImapParser::quote(d->name.toUtf8());
l << ImapParser::quote(d->icon.toUtf8());
l << ImapParser::quote(d->activeIcon.toUtf8());
......
......@@ -33,7 +33,7 @@ Attribute *FavoriteCollectionAttribute::clone() const
QByteArray FavoriteCollectionAttribute::type() const
{
return "favorite";
return QByteArrayLiteral("favorite");
}
void FavoriteCollectionAttribute::deserialize(const QByteArray &)
......
......@@ -28,10 +28,9 @@ class Q_DECL_HIDDEN IndexPolicyAttribute::Private
{
public:
Private()
: enable(true)
{
}
bool enable;
bool enable = true;
};
IndexPolicyAttribute::IndexPolicyAttribute()
......@@ -70,6 +69,7 @@ Attribute *IndexPolicyAttribute::clone() const
QByteArray IndexPolicyAttribute::serialized() const
{
QList<QByteArray> l;
l.reserve(2);
l.append("ENABLE");
l.append(d->enable ? "true" : "false");
return "(" + ImapParser::join(l, " ") + ')'; //krazy:exclude=doublequote_chars
......
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