diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-01-09 08:39:08 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-01-09 08:47:47 -0800 |
commit | 07fd147b9f12e9205afd66a624edce357977d615 (patch) | |
tree | 33f3d9ddf2a5c3a2866889edf3817b6656f0e61f /src/wallet/db.h | |
parent | 12e31127948fa4bb01c3bddc1b8c85b432f7465b (diff) | |
parent | 5113474a91b8dcac4de0e4566b9babd5da281f29 (diff) |
Merge #9353: Add data() method to CDataStream (and use it)
5113474 wallet: Use CDataStream.data() (Wladimir J. van der Laan)
e2300ff bench: Use CDataStream.data() (Wladimir J. van der Laan)
adff950 dbwrapper: Use new .data() method of CDataStream (Wladimir J. van der Laan)
a2141e4 streams: Remove special cases for ancient MSVC (Wladimir J. van der Laan)
af4c44c streams: Add data() method to CDataStream (Wladimir J. van der Laan)
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r-- | src/wallet/db.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index b78f0f092a..bc15f2147f 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -122,7 +122,7 @@ protected: CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(1000); ssKey << key; - Dbt datKey(&ssKey[0], ssKey.size()); + Dbt datKey(ssKey.data(), ssKey.size()); // Read Dbt datValue; @@ -158,13 +158,13 @@ protected: CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(1000); ssKey << key; - Dbt datKey(&ssKey[0], ssKey.size()); + Dbt datKey(ssKey.data(), ssKey.size()); // Value CDataStream ssValue(SER_DISK, CLIENT_VERSION); ssValue.reserve(10000); ssValue << value; - Dbt datValue(&ssValue[0], ssValue.size()); + Dbt datValue(ssValue.data(), ssValue.size()); // Write int ret = pdb->put(activeTxn, &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE)); @@ -187,7 +187,7 @@ protected: CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(1000); ssKey << key; - Dbt datKey(&ssKey[0], ssKey.size()); + Dbt datKey(ssKey.data(), ssKey.size()); // Erase int ret = pdb->del(activeTxn, &datKey, 0); @@ -207,7 +207,7 @@ protected: CDataStream ssKey(SER_DISK, CLIENT_VERSION); ssKey.reserve(1000); ssKey << key; - Dbt datKey(&ssKey[0], ssKey.size()); + Dbt datKey(ssKey.data(), ssKey.size()); // Exists int ret = pdb->exists(activeTxn, &datKey, 0); @@ -234,7 +234,7 @@ protected: Dbt datKey; unsigned int fFlags = DB_NEXT; if (setRange) { - datKey.set_data(&ssKey[0]); + datKey.set_data(ssKey.data()); datKey.set_size(ssKey.size()); fFlags = DB_SET_RANGE; } |