Skip to content

Commit

Permalink
Debug asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
MattHalpinParity committed Jan 10, 2024
1 parent 3d263d7 commit 59594a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ impl DbInner {
ref_count_batch_source,
} = column.reindex(&self.log)?;
if !batch.is_empty() || drop_index.is_some() {
assert!(
debug_assert!(
ref_count_batch.is_empty() &&
ref_count_batch_source.is_none() &&
drop_ref_count.is_none()
Expand Down Expand Up @@ -961,8 +961,8 @@ impl DbInner {
return Ok(true)
}
if !ref_count_batch.is_empty() || drop_ref_count.is_some() {
assert!(batch.is_empty() && drop_index.is_none());
assert!(ref_count_batch_source.is_some());
debug_assert!(batch.is_empty() && drop_index.is_none());
debug_assert!(ref_count_batch_source.is_some());
let ref_count_source = ref_count_batch_source.unwrap();
let mut next_reindex = false;
let mut writer = self.log.begin_record();
Expand Down
4 changes: 2 additions & 2 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ impl ValueTable {
self.last_removed.store(next_removed, Ordering::Relaxed);
if let Some(mut free_entries) = free_entries_guard {
let last = free_entries.stack.pop().unwrap();
assert_eq!(last, last_removed);
debug_assert_eq!(last, last_removed);
free_entries.ordered.remove(&last_removed);
}
last_removed
Expand All @@ -778,7 +778,7 @@ impl ValueTable {
let last_removed = self.last_removed.load(Ordering::Relaxed);
let index = if last_removed != 0 {
let last = free_entries.stack.pop().unwrap();
assert_eq!(last, last_removed);
debug_assert_eq!(last, last_removed);
free_entries.ordered.remove(&last_removed);

let next_removed = *free_entries.stack.last().unwrap_or(&0u64);
Expand Down

0 comments on commit 59594a2

Please sign in to comment.