Skip to content

Commit

Permalink
chore: made write data more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jul 23, 2023
1 parent addcd6e commit 9f90a83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontends/sdl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl Emulator {
// into a *.sav file in the file system
if counter % store_count == 0 && self.system.rom().has_battery() {
let ram_data = self.system.ram_data_eager();
write_file(&self.ram_path, ram_data);
write_file(&self.ram_path, &ram_data);
}

// obtains an event from the SDL sub-system to be
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn read_file(path: &str) -> Vec<u8> {
data
}

pub fn write_file(path: &str, data: Vec<u8>) {
pub fn write_file(path: &str, data: &Vec<u8>) {
let mut file = match File::create(path) {
Ok(file) => file,
Err(_) => panic!("Failed to open file: {}", path),
Expand Down

0 comments on commit 9f90a83

Please sign in to comment.