aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-qt/src/codecs/svq3.rs
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2021-10-29 14:40:07 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2021-10-29 14:40:07 +0200
commit379524159c95f1c3639976ccf35f9d47cd9732ac (patch)
treea420329fa8bbb301f2d290d4813621b1c64afd12 /nihav-qt/src/codecs/svq3.rs
parentfa49f0616b3b7f6454ea5722f8a6d1ca38908df6 (diff)
downloadnihav-379524159c95f1c3639976ccf35f9d47cd9732ac.tar.gz
replace vec.truncate(0) with vec.clear()
Diffstat (limited to 'nihav-qt/src/codecs/svq3.rs')
-rw-r--r--nihav-qt/src/codecs/svq3.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/nihav-qt/src/codecs/svq3.rs b/nihav-qt/src/codecs/svq3.rs
index 46480f5..d2cd385 100644
--- a/nihav-qt/src/codecs/svq3.rs
+++ b/nihav-qt/src/codecs/svq3.rs
@@ -140,13 +140,13 @@ impl MVInfo {
}
fn reset(&mut self) {
let size = self.w * self.h;
- self.mv_f.truncate(0);
+ self.mv_f.clear();
self.mv_f.resize(size, ZERO_MV);
- self.mv_b.truncate(0);
+ self.mv_b.clear();
self.mv_b.resize(size, ZERO_MV);
- self.has_f.truncate(0);
+ self.has_f.clear();
self.has_f.resize(size >> 4, false);
- self.has_b.truncate(0);
+ self.has_b.clear();
self.has_b.resize(size >> 4, false);
}
fn fill(&mut self, mb_x: usize, mb_y: usize, fwd: bool, mv: MV) {
@@ -518,7 +518,7 @@ unimplemented!();
};
let slice_len = length + llen + 1;
validate!(src.len() >= slice_len);
- self.slice_buf.truncate(0);
+ self.slice_buf.clear();
if llen > 1 {
self.slice_buf.extend_from_slice(&src[slice_len - llen + 1..][..llen - 1]);
}