Skip to content

Commit

Permalink
unneeded borrow_muts
Browse files Browse the repository at this point in the history
  • Loading branch information
pineman committed Mar 25, 2024
1 parent 3deb9f4 commit 4350f7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fpt-egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl FPT {
if self.cycles_since_last_frame == self.gb.borrow().cycles_in_one_frame() {
frame = {
let mut ppu_frame_copy: fpt::ppu::Frame = [0; 23040]; // should be optimized away?
ppu_frame_copy.copy_from_slice(self.gb.borrow_mut().get_frame());
ppu_frame_copy.copy_from_slice(self.gb.borrow().get_frame());
Option::from(ppu_frame_copy)
};
self.gb_frame_count += 1;
Expand All @@ -191,7 +191,7 @@ impl FPT {
// and then `self.image[(x, y)] = ... frame[z] ...` borrows self mutably and reads frame
let frame = {
let mut ppu_frame_copy: fpt::ppu::Frame = [0; 23040]; // should be optimized away?
ppu_frame_copy.copy_from_slice(self.gb.borrow_mut().get_frame());
ppu_frame_copy.copy_from_slice(self.gb.borrow().get_frame());
ppu_frame_copy
};
for z in 0..(WIDTH * HEIGHT) {
Expand Down

0 comments on commit 4350f7f

Please sign in to comment.