From b259728a4f63e022526ef86e6b5d6c62d9938d13 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 22 Dec 2015 19:51:34 +0100 Subject: Use the contains function where we can. --- common/pipeline.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/common/pipeline.cpp b/common/pipeline.cpp index d850154..f8b1fb1 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -159,14 +159,7 @@ KAsync::Job Pipeline::newEntity(void const *command, size_t size) QByteArray key; if (createEntity->entityId()) { key = QByteArray(reinterpret_cast(createEntity->entityId()->Data()), createEntity->entityId()->size()); - - bool found = false; - d->transaction.openDatabase(bufferType + ".main").scan(key, [&found](const QByteArray &, const QByteArray &value) -> bool { - found = true; - return false; - }, [this](const Akonadi2::Storage::Error &error) { - }, true); - if (found) { + if (d->transaction.openDatabase(bufferType + ".main").contains(key)) { ErrorMsg() << "An entity with this id already exists: " << key; return KAsync::error(0); } -- cgit v1.2.3