Skip to content

Commit

Permalink
Solve a TODO comment in a private method of base_cache::Inner
Browse files Browse the repository at this point in the history
Replace `entry.last_modified().is_none()` with `entry.is_dirty()`.
  • Loading branch information
tatsuya6502 committed Aug 19, 2023
1 parent ec396f2 commit f8c516a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/future/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2081,8 +2081,7 @@ where
}
Self::handle_remove(deqs, timer_wheel, entry, &mut eviction_state.counters);
} else if let Some(entry) = self.cache.get(hash, |k| k == key) {
// TODO: CHECKME: Should we check `entry.is_dirty()` instead?
if entry.last_modified().is_none() {
if entry.is_dirty() {
deqs.move_to_back_ao(&entry);
deqs.move_to_back_wo(&entry);
} else {
Expand Down
3 changes: 1 addition & 2 deletions src/sync_base/base_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2100,8 +2100,7 @@ where
}
Self::handle_remove(deqs, timer_wheel, entry, &mut eviction_state.counters);
} else if let Some(entry) = self.cache.get(hash, |k| k == key) {
// TODO: CHECKME: Should we check `entry.is_dirty()` instead?
if entry.last_modified().is_none() {
if entry.is_dirty() {
deqs.move_to_back_ao(&entry);
deqs.move_to_back_wo(&entry);
} else {
Expand Down

0 comments on commit f8c516a

Please sign in to comment.