Skip to content

Commit

Permalink
Compare CDataStream internal vector with unsigned comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Apr 5, 2019
1 parent dd21d04 commit 53656b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dbwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ class CDBTransaction {

struct DataStreamCmp {
static bool less(const CDataStream& a, const CDataStream& b) {
return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end());
return std::lexicographical_compare(
(const uint8_t*)a.data(), (const uint8_t*)a.data() + a.size(),
(const uint8_t*)b.data(), (const uint8_t*)b.data() + b.size());
}
bool operator()(const CDataStream& a, const CDataStream& b) const {
return less(a, b);
Expand Down

0 comments on commit 53656b3

Please sign in to comment.