mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
scripted-diff: Use inline const over (static) const
Both are fine and this refactor shouldn't change any behavior.
However, inline const will ensure each symbol has a single address
across all TU, making the release binary smaller.
-BEGIN VERIFY SCRIPT-
# Replace `static const`
sed -i "s/^static const /inline const /" $( \
git grep -l "^static const " -- \
'*.h' \
':(exclude)src/leveldb' \
':(exclude)src/secp256k1' \
)
# Replace plain `const`
sed -i --regexp-extended 's/^const (\S+ \w+(\[\])? ?[={])/inline &/' $( \
git grep -l '^const ' -- \
'*.h' \
':(exclude)src/leveldb' \
':(exclude)src/secp256k1' \
)
-END VERIFY SCRIPT-
This commit is contained in:
@@ -110,7 +110,7 @@ public:
|
||||
//!
|
||||
//! Because we only allow loading a single snapshot at a time, there will only be one
|
||||
//! chainstate directory with this filename present within it.
|
||||
const fs::path SNAPSHOT_BLOCKHASH_FILENAME{"base_blockhash"};
|
||||
inline const fs::path SNAPSHOT_BLOCKHASH_FILENAME{"base_blockhash"};
|
||||
|
||||
//! Write out the blockhash of the snapshot base block that was used to construct
|
||||
//! this chainstate. This value is read in during subsequent initializations and
|
||||
|
||||
Reference in New Issue
Block a user