Skip to content

Commit ae51f25

Browse files
committed
Replace Arc.clone()s with Arc::clone() in background-processor
`arc.clone()` leaves the code somewhat ambiguous to whether we're doing an expensive deep-clone operation or if we're doing a (relatively) cheap pointer-copy-and-atomic-increment operation. More importantly, it leaves entirely unclear what the semantics of the object we just created are - does updating it update the original or leave it be? Thus, here, we replace `arc.clone()` calls with `Arc::clone()` in `lightning-background-processor/src/lib.rs`
1 parent d89db75 commit ae51f25

File tree

1 file changed

+1
-1
lines changed
  • lightning-background-processor/src

1 file changed

+1
-1
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ impl BackgroundProcessor {
10211021
K::Target: 'static + KVStore,
10221022
{
10231023
let stop_thread = Arc::new(AtomicBool::new(false));
1024-
let stop_thread_clone = stop_thread.clone();
1024+
let stop_thread_clone = Arc::clone(&stop_thread);
10251025
let handle = thread::spawn(move || -> Result<(), std::io::Error> {
10261026
let event_handler = |event| {
10271027
let network_graph = gossip_sync.network_graph();

0 commit comments

Comments
 (0)