From 054f38a44e6db9cee2fd391ccb4b01666e53c270 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Thu, 21 Mar 2024 18:39:24 -0700 Subject: [PATCH] * Address file_size() in #381. Remove TODO comments. --- accounts-db/src/accounts_file.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/accounts-db/src/accounts_file.rs b/accounts-db/src/accounts_file.rs index e21b984e68b689..1e44880670b1aa 100644 --- a/accounts-db/src/accounts_file.rs +++ b/accounts-db/src/accounts_file.rs @@ -113,7 +113,6 @@ 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, } } @@ -121,7 +120,6 @@ impl AccountsFile { 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, } } @@ -132,7 +130,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); }