Skip to content

Commit

Permalink
Consolidate status_cache_path assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangzhu70 committed Jan 31, 2023
1 parent 7f27373 commit 0983823
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runtime/src/snapshot_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@ pub fn get_bank_snapshots(bank_snapshots_dir: impl AsRef<Path>) -> Vec<BankSnaps
let bank_snapshot_outer_dir = get_bank_snapshots_dir(&bank_snapshots_dir, slot);
let bank_snapshot_post_path =
bank_snapshot_outer_dir.join(get_snapshot_file_name(slot));
let status_cache_path =
bank_snapshot_outer_dir.join(SNAPSHOT_STATUS_CACHE_FILENAME);
let mut bank_snapshot_pre_path = bank_snapshot_post_path.clone();
bank_snapshot_pre_path.set_extension(BANK_SNAPSHOT_PRE_FILENAME_EXTENSION);

Expand All @@ -600,8 +602,7 @@ pub fn get_bank_snapshots(bank_snapshots_dir: impl AsRef<Path>) -> Vec<BankSnaps
slot,
snapshot_path: bank_snapshot_pre_path,
snapshot_type: BankSnapshotType::Pre,
status_cache_path: bank_snapshot_outer_dir
.join(SNAPSHOT_STATUS_CACHE_FILENAME),
status_cache_path: status_cache_path.clone(),
});
}

Expand All @@ -610,8 +611,7 @@ pub fn get_bank_snapshots(bank_snapshots_dir: impl AsRef<Path>) -> Vec<BankSnaps
slot,
snapshot_path: bank_snapshot_post_path,
snapshot_type: BankSnapshotType::Post,
status_cache_path: bank_snapshot_outer_dir
.join(SNAPSHOT_STATUS_CACHE_FILENAME),
status_cache_path,
});
}
}),
Expand Down

0 comments on commit 0983823

Please sign in to comment.