Skip to content

Commit

Permalink
* Address file_size() in solana-labs#381. Remove TODO comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhchiang-sol committed Mar 22, 2024
1 parent 4dd11dd commit 669b496
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions accounts-db/src/accounts_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,13 @@ impl AccountsFile {
pub fn len(&self) -> usize {
match self {
Self::AppendVec(av) => av.len(),
// TODO(yhchiang): use cached result when the file is read-only
Self::TieredStorage(ts) => ts.file_size().unwrap_or(0) as usize,
}
}

pub fn is_empty(&self) -> bool {
match self {
Self::AppendVec(av) => av.is_empty(),
// TODO(yhchiang): use cached result when the file is read-only
Self::TieredStorage(ts) => ts.file_size().unwrap_or(0) == 0,
}
}
Expand All @@ -133,7 +131,6 @@ impl AccountsFile {
Self::TieredStorage(ts) => {
// As TieredStorage doesn't have the concept about capacity,
// here we return the file size when the file was written.
// TODO(yhchiang): use cached result when the file is read-only
if ts.is_read_only() {
return ts.file_size().unwrap_or(0);
}
Expand Down

0 comments on commit 669b496

Please sign in to comment.