Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/lib: delete unwanted print_xxx API functions #50

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,49 +723,6 @@ impl Gdbm {

Ok(Some(data))
}

// API: print bucket directory
pub fn print_dir(&self) {
println!(
"size = {}, bits = {}, buckets = ?",
self.header.dir_sz, self.header.dir_bits
);

for idx in 0..self.dir.len() {
println!("{}: {}", idx, self.dir.dir[idx]);
}
}

// API: print bucket
pub fn print_bucket(&mut self, bucket_dir: usize) -> io::Result<()> {
self.cache_load_bucket(bucket_dir)?;
let bucket_ofs = self.dir.dir[bucket_dir];
let bucket = self.bucket_cache.bucket_map[&bucket_ofs].clone();

println!("bits = {}", bucket.bits);
println!("count = {}", bucket.count);

for idx in 0..bucket.tab.len() {
let elem = &bucket.tab[idx];
println!(
"{} {:x} {} {} {} {}",
idx,
elem.hash,
elem.key_size,
elem.data_size,
elem.data_ofs,
String::from_utf8_lossy(&elem.key_start)
);
}

println!("avail count = {}", bucket.avail.len());
println!("Address Size");
for av_elem in &bucket.avail {
println!("{} {}", av_elem.addr, av_elem.sz);
}

Ok(())
}
}

#[cfg(test)]
Expand Down
Loading