mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-13 14:13:52 +02:00
3e8e21b2eftxgraph: avoid moving primitive members (Lőrinc)d9f94aa882rpc: avoid moving RPC enum types (Lőrinc)b67baed4e7coins: avoid moving `COutPoint` values (Lőrinc) Pull request description: Inspired by https://github.com/bitcoin/bitcoin/pull/34320#discussion_r2751764873. **Problem:** A few code paths use rvalue references or `std::move()` for types where moving provides no benefit. `EmplaceCoinInternalDANGER` took `COutPoint&&`, forcing callers to pass trivially copyable outpoints as rvalues even though the cache stores its own key. Some call sites also use `std::move()` on enum and primitive values, where it only adds noise. > [!NOTE] > `CheckTriviallyCopyableMove` remains `false` since `std::move()` on trivially copyable types can still be useful as intent documentation, for example to signal that a value should not be reused after a call. **Fix:** Take trivially copyable arguments by const reference where the callee only needs to store its own copy, and pass existing values directly at the call sites. Also remove `std::move()` from enum and primitive assignments where it has no semantic effect. ACKs for top commit: maflcko: review ACK3e8e21b2ef🖇 hodlinator: re-ACK3e8e21b2efandrewtoth: ACK3e8e21b2efhebasto: ACK3e8e21b2ef, I have reviewed the code and it looks OK. Tree-SHA512: cbe55b13290ae261bba359dc6e5a3bbdfb7ae9d31bdf8e0da2eef65a0df776e4081ceeac3c82731a631bda656a86b3789651fa1f4d87875cee1dc96351bdfd7c
50 KiB
50 KiB