Skip to content

Commit 6eaac05

Browse files
committed
Controller::shared(), return &Arc to let caller decide to clone
1 parent 4d24bc1 commit 6eaac05

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/control.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ impl Default for Controller {
2222
}
2323

2424
impl Controller {
25-
pub fn shared(&self) -> Arc<ControllerShared> {
26-
Arc::clone(&self.shared)
25+
pub fn shared(&self) -> &Arc<ControllerShared> {
26+
&self.shared
2727
}
2828

2929
pub fn loop_(&self) -> bool {

src/node/audio_buffer_source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl AudioBufferSourceNode {
185185
controller.set_loop(loop_);
186186
controller.set_loop_start(loop_start);
187187
controller.set_loop_end(loop_end);
188-
let controller_shared = controller.shared();
188+
let controller_shared = Arc::clone(controller.shared());
189189

190190
let renderer = AudioBufferSourceRenderer {
191191
start_time: f64::MAX,

0 commit comments

Comments
 (0)