mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 18:22:57 +02:00
Merge bitcoin/bitcoin#29071: refactor: Remove Span operator==, Use std::ranges::equal
fad0cf6f26refactor: Use std::ranges::equal in GetNetworkForMagic (MarcoFalke)fadf0a7e15refactor: Remove Span operator==, Use std::ranges::equal (MarcoFalke) Pull request description: `std::span` removed the comparison operators, so it makes sense to remove them for the `Span` "backport" as well. Using `std::ranges::equal` also has the benefit that some `Span` temporary constructions can now be dropped. This is required to move from `Span` toward `std::span`. ACKs for top commit: hodlinator: Untested Code Review re-ACKfad0cf6stickies-v: ACKfad0cf6f26TheCharlatan: ACKfad0cf6f26Tree-SHA512: 5b9d1826ceac2aabae2295bc89893dd23ac3a1cc0d41988331cdbdc21be531aa91795d5273819f349f79648c6c4f30ed31af6e7a3816153e92080061b92ffe00
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <util/fs.h>
|
||||
#include <wallet/db.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
@@ -16,8 +17,8 @@
|
||||
#include <vector>
|
||||
|
||||
namespace wallet {
|
||||
bool operator<(BytePrefix a, Span<const std::byte> b) { return a.prefix < b.subspan(0, std::min(a.prefix.size(), b.size())); }
|
||||
bool operator<(Span<const std::byte> a, BytePrefix b) { return a.subspan(0, std::min(a.size(), b.prefix.size())) < b.prefix; }
|
||||
bool operator<(BytePrefix a, Span<const std::byte> b) { return std::ranges::lexicographical_compare(a.prefix, b.subspan(0, std::min(a.prefix.size(), b.size()))); }
|
||||
bool operator<(Span<const std::byte> a, BytePrefix b) { return std::ranges::lexicographical_compare(a.subspan(0, std::min(a.size(), b.prefix.size())), b.prefix); }
|
||||
|
||||
std::vector<std::pair<fs::path, std::string>> ListDatabases(const fs::path& wallet_dir)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user