diff options
| author | Pieter Wuille <[email protected]> | 2017-07-07 00:54:42 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2017-07-07 10:45:31 -0700 |
| commit | 0aadc11fd88b298c7af2dfb69763b2c67dc6b7b0 (patch) | |
| tree | 02bb833749f472a916c9ff5f585af9e94b5326b8 /src/test/dbwrapper_tests.cpp | |
| parent | Merge #10698: Be consistent in calling transactions "replaceable" for Opt-In RBF (diff) | |
| download | discoin-0aadc11fd88b298c7af2dfb69763b2c67dc6b7b0.tar.xz discoin-0aadc11fd88b298c7af2dfb69763b2c67dc6b7b0.zip | |
Avoid dereference-of-casted-pointer
Diffstat (limited to 'src/test/dbwrapper_tests.cpp')
| -rw-r--r-- | src/test/dbwrapper_tests.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/dbwrapper_tests.cpp b/src/test/dbwrapper_tests.cpp index be631ce7a..093509e61 100644 --- a/src/test/dbwrapper_tests.cpp +++ b/src/test/dbwrapper_tests.cpp @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(dbwrapper_iterator) uint256 in2 = InsecureRand256(); BOOST_CHECK(dbw.Write(key2, in2)); - std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper*>(&dbw)->NewIterator()); + std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator()); // Be sure to seek past the obfuscation key (if it exists) it->Seek(key); @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(iterator_ordering) BOOST_CHECK(dbw.Write(key, value)); } - std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper*>(&dbw)->NewIterator()); + std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator()); for (int c=0; c<2; ++c) { int seek_start; if (c == 0) @@ -286,7 +286,7 @@ BOOST_AUTO_TEST_CASE(iterator_string_ordering) } } - std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper*>(&dbw)->NewIterator()); + std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator()); for (int c=0; c<2; ++c) { int seek_start; if (c == 0) |