diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-25 22:06:24 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-05-25 22:06:24 +0200 |
commit | 01002ca7602b8d8a569c6d7191a1ba1ad03f3e65 (patch) | |
tree | 101de30e4fb8804b49426f10b3d9e92e16b5533c /common/typeindex.cpp | |
parent | f927094726d6757e6abccc71c353738687f1080e (diff) | |
download | sink-01002ca7602b8d8a569c6d7191a1ba1ad03f3e65.tar.gz sink-01002ca7602b8d8a569c6d7191a1ba1ad03f3e65.zip |
Don't store references to temporarily valid data.
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r-- | common/typeindex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp index a897ad0..180343a 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp | |||
@@ -325,7 +325,7 @@ QVector<QByteArray> TypeIndex::secondaryLookup<QByteArray>(const QByteArray &lef | |||
325 | Index index(indexName(leftName + rightName), *mTransaction); | 325 | Index index(indexName(leftName + rightName), *mTransaction); |
326 | const auto lookupKey = getByteArray(value); | 326 | const auto lookupKey = getByteArray(value); |
327 | index.lookup( | 327 | index.lookup( |
328 | lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Lookup error in secondary index: " << error.message << value << lookupKey; }); | 328 | lookupKey, [&](const QByteArray &value) { keys << QByteArray{value.constData(), value.size()}; }, [=](const Index::Error &error) { SinkWarning() << "Lookup error in secondary index: " << error.message << value << lookupKey; }); |
329 | 329 | ||
330 | return keys; | 330 | return keys; |
331 | } | 331 | } |
@@ -337,7 +337,7 @@ QVector<QByteArray> TypeIndex::secondaryLookup<QString>(const QByteArray &leftNa | |||
337 | Index index(indexName(leftName + rightName), *mTransaction); | 337 | Index index(indexName(leftName + rightName), *mTransaction); |
338 | const auto lookupKey = getByteArray(value); | 338 | const auto lookupKey = getByteArray(value); |
339 | index.lookup( | 339 | index.lookup( |
340 | lookupKey, [&](const QByteArray &value) { keys << value; }, [=](const Index::Error &error) { SinkWarning() << "Lookup error in secondary index: " << error.message << value << lookupKey; }); | 340 | lookupKey, [&](const QByteArray &value) { keys << QByteArray{value.constData(), value.size()}; }, [=](const Index::Error &error) { SinkWarning() << "Lookup error in secondary index: " << error.message << value << lookupKey; }); |
341 | 341 | ||
342 | return keys; | 342 | return keys; |
343 | } | 343 | } |