mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 23:03:45 +01:00
scripted-diff: Use std::span over Span
-BEGIN VERIFY SCRIPT-
ren() { sed -i "s!\<$1\>!$2!g" $( git grep -l "$1" -- "./src" ":(exclude)src/span.h" ":(exclude)src/leveldb/db/log_test.cc" ) ; }
ren Span std::span
ren AsBytes std::as_bytes
ren AsWritableBytes std::as_writable_bytes
sed -i 's!SpanPopBack(Span!SpanPopBack(std::span!g' ./src/span.h
-END VERIFY SCRIPT-
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
namespace wallet {
|
||||
static constexpr int32_t WALLET_SCHEMA_VERSION = 0;
|
||||
|
||||
static Span<const std::byte> SpanFromBlob(sqlite3_stmt* stmt, int col)
|
||||
static std::span<const std::byte> SpanFromBlob(sqlite3_stmt* stmt, int col)
|
||||
{
|
||||
return {reinterpret_cast<const std::byte*>(sqlite3_column_blob(stmt, col)),
|
||||
static_cast<size_t>(sqlite3_column_bytes(stmt, col))};
|
||||
@@ -60,7 +60,7 @@ static int TraceSqlCallback(unsigned code, void* context, void* param1, void* pa
|
||||
|
||||
static bool BindBlobToStatement(sqlite3_stmt* stmt,
|
||||
int index,
|
||||
Span<const std::byte> blob,
|
||||
std::span<const std::byte> blob,
|
||||
const std::string& description)
|
||||
{
|
||||
// Pass a pointer to the empty string "" below instead of passing the
|
||||
@@ -513,7 +513,7 @@ bool SQLiteBatch::WriteKey(DataStream&& key, DataStream&& value, bool overwrite)
|
||||
return res == SQLITE_DONE;
|
||||
}
|
||||
|
||||
bool SQLiteBatch::ExecStatement(sqlite3_stmt* stmt, Span<const std::byte> blob)
|
||||
bool SQLiteBatch::ExecStatement(sqlite3_stmt* stmt, std::span<const std::byte> blob)
|
||||
{
|
||||
if (!m_database.m_db) return false;
|
||||
assert(stmt);
|
||||
@@ -542,7 +542,7 @@ bool SQLiteBatch::EraseKey(DataStream&& key)
|
||||
return ExecStatement(m_delete_stmt, key);
|
||||
}
|
||||
|
||||
bool SQLiteBatch::ErasePrefix(Span<const std::byte> prefix)
|
||||
bool SQLiteBatch::ErasePrefix(std::span<const std::byte> prefix)
|
||||
{
|
||||
return ExecStatement(m_delete_prefix_stmt, prefix);
|
||||
}
|
||||
@@ -606,7 +606,7 @@ std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewCursor()
|
||||
return cursor;
|
||||
}
|
||||
|
||||
std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewPrefixCursor(Span<const std::byte> prefix)
|
||||
std::unique_ptr<DatabaseCursor> SQLiteBatch::GetNewPrefixCursor(std::span<const std::byte> prefix)
|
||||
{
|
||||
if (!m_database.m_db) return nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user