Compare CDataStream internal vector with unsigned comparison

This commit is contained in:
Alexander Block 2019-04-05 13:37:58 +02:00
parent dd21d046f5
commit 53656b3e82

View File

@ -553,7 +553,9 @@ protected:
struct DataStreamCmp { struct DataStreamCmp {
static bool less(const CDataStream& a, const CDataStream& b) { 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 { bool operator()(const CDataStream& a, const CDataStream& b) const {
return less(a, b); return less(a, b);