diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-05 17:48:41 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-05 17:48:41 +0200 |
commit | 0acbe51f75bd1791b30d43e337c15e50680ae8c5 (patch) | |
tree | 7592ff49285085223453f2e0789632b315051cf5 | |
parent | b135813110db7de8625bd2902e49afd971af9756 (diff) | |
download | sink-0acbe51f75bd1791b30d43e337c15e50680ae8c5.tar.gz sink-0acbe51f75bd1791b30d43e337c15e50680ae8c5.zip |
These checks are no longer necessary
-rw-r--r-- | common/messagequeue.cpp | 4 | ||||
-rw-r--r-- | common/queryrunner.cpp | 4 | ||||
-rw-r--r-- | examples/imapresource/imapresource.cpp | 3 | ||||
-rw-r--r-- | examples/maildirresource/maildirresource.cpp | 3 | ||||
-rw-r--r-- | 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<void> MessageQueue::dequeueBatch(int maxBatchSize, const std::functi | |||
112 | .openDatabase() | 112 | .openDatabase() |
113 | .scan("", | 113 | .scan("", |
114 | [this, resultHandler, resultCount, &count, maxBatchSize, &waitCondition](const QByteArray &key, const QByteArray &value) -> bool { | 114 | [this, resultHandler, resultCount, &count, maxBatchSize, &waitCondition](const QByteArray &key, const QByteArray &value) -> bool { |
115 | if (Sink::Storage::isInternalKey(key) || mPendingRemoval.contains(key)) { | 115 | if (mPendingRemoval.contains(key)) { |
116 | return true; | 116 | return true; |
117 | } | 117 | } |
118 | *resultCount += 1; | 118 | *resultCount += 1; |
@@ -158,7 +158,7 @@ bool MessageQueue::isEmpty() | |||
158 | if (db) { | 158 | if (db) { |
159 | db.scan("", | 159 | db.scan("", |
160 | [&count, this](const QByteArray &key, const QByteArray &value) -> bool { | 160 | [&count, this](const QByteArray &key, const QByteArray &value) -> bool { |
161 | if (!Sink::Storage::isInternalKey(key) && !mPendingRemoval.contains(key)) { | 161 | if (!mPendingRemoval.contains(key)) { |
162 | count++; | 162 | count++; |
163 | return false; | 163 | return false; |
164 | } | 164 | } |
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, | |||
156 | Storage::mainDatabase(transaction, bufferType) | 156 | Storage::mainDatabase(transaction, bufferType) |
157 | .scan(QByteArray(), | 157 | .scan(QByteArray(), |
158 | [&](const QByteArray &key, const QByteArray &value) -> bool { | 158 | [&](const QByteArray &key, const QByteArray &value) -> bool { |
159 | // Skip internals | ||
160 | if (Sink::Storage::isInternalKey(key)) { | ||
161 | return true; | ||
162 | } | ||
163 | if (keys.contains(Sink::Storage::uidFromKey(key))) { | 159 | if (keys.contains(Sink::Storage::uidFromKey(key))) { |
164 | //Not something that should persist if the replay works, so we keep a message for now. | 160 | //Not something that should persist if the replay works, so we keep a message for now. |
165 | Trace() << "Multiple revisions for key: " << key; | 161 | 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: | |||
141 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Sink::Storage::Error &)>(), true); | 141 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Sink::Storage::Error &)>(), true); |
142 | auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); | 142 | auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); |
143 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { | 143 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { |
144 | if (Sink::Storage::isInternalKey(key)) { | ||
145 | return true; | ||
146 | } | ||
147 | callback(key); | 144 | callback(key); |
148 | return true; | 145 | return true; |
149 | }); | 146 | }); |
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: | |||
289 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Sink::Storage::Error &)>(), true); | 289 | // auto remoteIds = synchronizationTransaction.openDatabase("rid.mapping." + bufferType, std::function<void(const Sink::Storage::Error &)>(), true); |
290 | auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); | 290 | auto mainDatabase = Sink::Storage::mainDatabase(transaction(), bufferType); |
291 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { | 291 | mainDatabase.scan("", [&](const QByteArray &key, const QByteArray &) { |
292 | if (Sink::Storage::isInternalKey(key)) { | ||
293 | return true; | ||
294 | } | ||
295 | callback(key); | 292 | callback(key); |
296 | return true; | 293 | return true; |
297 | }); | 294 | }); |
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<QByteArray> getKeys(const QByteArray &dbEnv, const QByteArray &name | |||
34 | auto db = transaction.openDatabase(name, nullptr, false); | 34 | auto db = transaction.openDatabase(name, nullptr, false); |
35 | QList<QByteArray> result; | 35 | QList<QByteArray> result; |
36 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { | 36 | db.scan("", [&](const QByteArray &key, const QByteArray &value) { |
37 | if (Sink::Storage::isInternalKey(key)) { | ||
38 | return true; | ||
39 | } | ||
40 | result << key; | 37 | result << key; |
41 | return true; | 38 | return true; |
42 | }); | 39 | }); |