Skip to content

Commit 5be20b4

Browse files
committed
Tiny perf. fixup in TxHash2TxNumMgr consistencyCheck() function
Opportunity to avoid copying taken.
1 parent 597dfc2 commit 5be20b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Storage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,9 @@ namespace {
10071007
const auto txNum = batchNums[i];
10081008
if (batch[i].second != txNum) throw DatabaseError("txNum mismatch");
10091009
if (hash.length() != HashLen) throw DatabaseFormatError("bad record");
1010-
const auto expect = makeKeyFromHash(hash).toByteArray();
1010+
const auto expect = makeKeyFromHash(hash).toByteArray(false);
10111011
const auto &keyStr = batch[i].first;
1012-
const auto key = QByteArray::fromRawData(keyStr.data(), keyStr.size());
1012+
const auto key = ShallowTmp(keyStr.data(), keyStr.size());
10131013
if (key != expect)
10141014
throw DatabaseError(QString("record %1 does not match key. expected: %2, got: %3")
10151015
.arg(txNum).arg(QString(expect.toHex()), QString(key.toHex())));

0 commit comments

Comments
 (0)