diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-10-29 14:40:07 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2021-10-29 14:40:07 +0200 |
commit | 379524159c95f1c3639976ccf35f9d47cd9732ac (patch) | |
tree | a420329fa8bbb301f2d290d4813621b1c64afd12 /nihav-indeo/src | |
parent | fa49f0616b3b7f6454ea5722f8a6d1ca38908df6 (diff) | |
download | nihav-379524159c95f1c3639976ccf35f9d47cd9732ac.tar.gz |
replace vec.truncate(0) with vec.clear()
Diffstat (limited to 'nihav-indeo/src')
-rw-r--r-- | nihav-indeo/src/codecs/indeo3.rs | 8 | ||||
-rw-r--r-- | nihav-indeo/src/codecs/ivibr.rs | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/nihav-indeo/src/codecs/indeo3.rs b/nihav-indeo/src/codecs/indeo3.rs index 4048385..9e0ee11 100644 --- a/nihav-indeo/src/codecs/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -31,8 +31,8 @@ impl Buffers { fn reset(&mut self) { self.width = 0; self.height = 0; - self.sbuf.truncate(0); - self.dbuf.truncate(0); + self.sbuf.clear(); + self.dbuf.clear(); } fn alloc(&mut self, w: usize, h: usize) { self.width = w; @@ -635,7 +635,7 @@ impl Indeo3Decoder { let nvec = br.read_u32le()?; validate!(nvec == 0); // for intra there should be no mc_vecs - self.mvs.truncate(0); + self.mvs.clear(); for _ in 0..nvec { let x = br.read_byte()? as i8; let y = br.read_byte()? as i8; @@ -662,7 +662,7 @@ impl Indeo3Decoder { let nvec = br.read_u32le()?; validate!(nvec <= 256); // for intra there should be no mc_vecs - self.mvs.truncate(0); + self.mvs.clear(); for _ in 0..nvec { let y = br.read_byte()? as i8; let x = br.read_byte()? as i8; diff --git a/nihav-indeo/src/codecs/ivibr.rs b/nihav-indeo/src/codecs/ivibr.rs index 141200c..8ce4d1b 100644 --- a/nihav-indeo/src/codecs/ivibr.rs +++ b/nihav-indeo/src/codecs/ivibr.rs @@ -510,8 +510,8 @@ impl IVIDecoder { fn realloc(&mut self, pic_hdr: &PictureHeader) -> DecoderResult<()> { let planes = if pic_hdr.transparent { 4 } else { 3 }; - //self.bands.truncate(0); - self.tiles.truncate(0); + //self.bands.clear(); + self.tiles.clear(); self.num_tiles = [[0; 4]; 4]; self.tile_start = [[0; 4]; 4]; let mut tstart: usize = 0; @@ -582,7 +582,7 @@ impl IVIDecoder { let mb_h = (tile.h + mb_size - 1) / mb_size; tile.mb_w = mb_w; tile.mb_h = mb_h; - tile.mb.truncate(0); + tile.mb.clear(); tile.mb.resize(mb_w * mb_h, MB::new(0, 0)); } |