Removed log should *always* be backed up before truncate

This commit is contained in:
Ignotus Peverell 2017-12-17 21:24:43 +00:00
parent 5b0fc60fe2
commit 2caa0b79e0
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -187,11 +187,12 @@ impl RemoveLog {
// DEBUG // DEBUG
let _ = self.flush_truncate(last_offs); let _ = self.flush_truncate(last_offs);
// backing it up before truncating
self.removed_bak = self.removed.clone();
if last_offs == 0 { if last_offs == 0 {
self.removed = vec![]; self.removed = vec![];
} else { } else {
// backing it up before truncating
self.removed_bak = self.removed.clone();
self.removed = self.removed self.removed = self.removed
.iter() .iter()
.filter(|&&(_, idx)| idx < last_offs) .filter(|&&(_, idx)| idx < last_offs)