From 0acbe51f75bd1791b30d43e337c15e50680ae8c5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 5 Jun 2016 17:48:41 +0200 Subject: These checks are no longer necessary --- common/messagequeue.cpp | 4 ++-- common/queryrunner.cpp | 4 ---- examples/imapresource/imapresource.cpp | 3 --- examples/maildirresource/maildirresource.cpp | 3 --- tests/pipelinetest.cpp | 3 --- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/common/messagequeue.cpp b/common/messagequeue.cpp index fd86635..b9f11f8 100644 --- a/common/messagequeue.cpp +++ b/common/messagequeue.cpp @@ -112,7 +112,7 @@ KAsync::Job MessageQueue::dequeueBatch(int maxBatchSize, const std::functi .openDatabase() .scan("", [this, resultHandler, resultCount, &count, maxBatchSize, &waitCondition](const QByteArray &key, const QByteArray &value) -> bool { - if (Sink::Storage::isInternalKey(key) || mPendingRemoval.contains(key)) { + if (mPendingRemoval.contains(key)) { return true; } *resultCount += 1; @@ -158,7 +158,7 @@ bool MessageQueue::isEmpty() if (db) { db.scan("", [&count, this](const QByteArray &key, const QByteArray &value) -> bool { - if (!Sink::Storage::isInternalKey(key) && !mPendingRemoval.contains(key)) { + if (!mPendingRemoval.contains(key)) { count++; return false; } diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index b304384..cb8157e 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp @@ -156,10 +156,6 @@ static inline ResultSet fullScan(const Sink::Storage::Transaction &transaction, Storage::mainDatabase(transaction, bufferType) .scan(QByteArray(), [&](const QByteArray &key, const QByteArray &value) -> bool { - // Skip internals - if (Sink::Storage::isInternalKey(key)) { - return true; - } if (keys.contains(Sink::Storage::uidFromKey(key))) { //Not something that should persist if the replay works, so we keep a message for now. Trace() << "Multiple revisions for key: " << key; diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index b8129cd..6168fa4 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp @@ -141,9 +141,6 @@ public: // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function(), true); auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { - if (Sink::Storage::isInternalKey(key)) { - return true; - } callback(key); return true; }); diff --git a/examples/maildirresource/maildirresource.cpp b/examples/maildirresource/maildirresource.cpp index 18f8334..9800f7f 100644 --- a/examples/maildirresource/maildirresource.cpp +++ b/examples/maildirresource/maildirresource.cpp @@ -289,9 +289,6 @@ public: // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function(), true); auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { - if (Sink::Storage::isInternalKey(key)) { - return true; - } callback(key); return true; }); diff --git a/tests/pipelinetest.cpp b/tests/pipelinetest.cpp index 6cb327f..c6ee9ab 100644 --- a/tests/pipelinetest.cpp +++ b/tests/pipelinetest.cpp @@ -34,9 +34,6 @@ static QList getKeys(const QByteArray &dbEnv, const QByteArray &name auto db = transaction.openDatabase(name, nullptr, false); QList result; db.scan("", [&](const QByteArray &key, const QByteArray &value) { - if (Sink::Storage::isInternalKey(key)) { - return true; - } result << key; return true; }); -- cgit v1.2.3