Commit 1273d81a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Minor optimization

parent e94592ae
Pipeline #41724 passed with stage
in 9 minutes and 21 seconds
......@@ -70,7 +70,7 @@ public:
QString mMatchedDn;
QList<QByteArray> mReferrals;
LdapConnection *mConnection;
LdapConnection *mConnection = nullptr;
};
LdapOperation::LdapOperation()
......@@ -156,7 +156,6 @@ QByteArray LdapOperation::serverCred() const
}
LdapOperation::LdapOperationPrivate::LdapOperationPrivate()
: mConnection(nullptr)
{
}
......
......@@ -23,7 +23,6 @@ class LdapSearchPrivate
public:
LdapSearchPrivate(LdapSearch *parent)
: mParent(parent)
, mConn(nullptr)
{
}
......@@ -32,7 +31,7 @@ public:
void closeConnection();
bool startSearch(const LdapDN &base, LdapUrl::Scope scope, const QString &filter, const QStringList &attributes, int pagesize, int count);
LdapSearch *mParent = nullptr;
LdapSearch *const mParent;
LdapConnection *mConn = nullptr;
LdapOperation mOp;
bool mOwnConnection = false;
......
......@@ -233,7 +233,7 @@ void LdapUrl::parseQuery()
}
// split into a list
QStringList url_items = q.split(QLatin1Char('?'));
const QStringList url_items = q.split(QLatin1Char('?'));
d->m_attributes.clear();
d->m_scope = Base;
......
......@@ -235,14 +235,14 @@ Ldif::ParseValue Ldif::processLine()
}
break;
case Entry_Add:
if (d->mAttr.isEmpty() && d->mValue.size() == 0) {
if (d->mAttr.isEmpty() && d->mValue.isEmpty()) {
retval = EndEntry;
} else {
retval = Item;
}
break;
case Entry_Del:
if (d->mAttr.isEmpty() && d->mValue.size() == 0) {
if (d->mAttr.isEmpty() && d->mValue.isEmpty()) {
retval = EndEntry;
} else {
retval = Err;
......@@ -251,7 +251,7 @@ Ldif::ParseValue Ldif::processLine()
case Entry_Mod:
if (d->mModType == Mod_None) {
qCDebug(LDAP_LOG) << "new modtype" << d->mAttr;
if (d->mAttr.isEmpty() && d->mValue.size() == 0) {
if (d->mAttr.isEmpty() && d->mValue.isEmpty()) {
retval = EndEntry;
} else if (attrLower == QLatin1String("add")) {
d->mModType = Mod_Add;
......@@ -272,7 +272,7 @@ Ldif::ParseValue Ldif::processLine()
if (d->mAttr.isEmpty()) {
if (QString::fromUtf8(d->mValue) == QLatin1String("-")) {
d->mModType = Mod_None;
} else if (d->mValue.size() == 0) {
} else if (d->mValue.isEmpty()) {
retval = EndEntry;
} else {
retval = Err;
......@@ -283,7 +283,7 @@ Ldif::ParseValue Ldif::processLine()
}
break;
case Entry_Modrdn:
if (d->mAttr.isEmpty() && d->mValue.size() == 0) {
if (d->mAttr.isEmpty() && d->mValue.isEmpty()) {
retval = EndEntry;
} else if (attrLower == QLatin1String("newrdn")) {
d->mNewRdn = QString::fromUtf8(d->mValue);
......
......@@ -35,7 +35,6 @@ int main(int argc, char *argv[])
}
TestLDAPClient::TestLDAPClient()
: mClient(nullptr)
{
}
......
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