mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
Merge bitcoin/bitcoin#26345: refactor: modernize the implementation of uint256.*
935acdcc79refactor: modernize the implementation of uint256.* (pasta) Pull request description: - Constructors of uint256 to utilize Span instead of requiring a std::vector - converts m_data into a std::array - Prefers using `WIDTH` instead of `sizeof(m_data)` - make all the things constexpr - replace C style functions with c++ equivalents - memset -> std::fill This may also be replaced by std::memset, but I think that std::fill is more idiomatic of modern c++ and readable. - memcpy -> std::copy Note: In practice, implementations of std::copy avoid multiple assignments and use bulk copy functions such as std::memmove if the value type is TriviallyCopyable and the iterator types satisfy LegacyContiguousIterator. (https://en.cppreference.com/w/cpp/algorithm/copy) This could also likely be replaced by std::memcpy, but as said above, I believe the using std::copy is the more c++ way to do anything and is almost guaranteed to compile to the same asm - memcmp -> std::memcmp ACKs for top commit: achow101: ACK935acdcc79hebasto: Approach ACK935acdcc79. aureleoules: reACK935acdcc79john-moffett: ACK935acdcc79stickies-v: Approach ACK935acdcc7Tree-SHA512: 4f1ba54ff2198eea0e505d41e73d552c84c60f6878d5c85a94a8ab57f39afc94ef8d79258e7afd01fa84ec2a99f4404bb877eecd671f65e1ee9273f3129fc650
This commit is contained in:
@@ -60,6 +60,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
|
||||
" src/rpc/signmessage.cpp"\
|
||||
" src/test/fuzz/txorphan.cpp"\
|
||||
" src/test/fuzz/util/"\
|
||||
" src/uint256.cpp"\
|
||||
" src/util/bip32.cpp"\
|
||||
" src/util/bytevectorhash.cpp"\
|
||||
" src/util/check.cpp"\
|
||||
|
||||
Reference in New Issue
Block a user