Skip to content

Commit 621340d

Browse files
Remove unused BatchContainer methods (#451)
* Remove BatchContainer::reserve * Remove BatchContainer::copy_slice
1 parent 304ed9d commit 621340d

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

src/trace/implementations/huffman_container.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ where
8484
}
8585
}
8686
}
87-
fn copy_slice(&mut self, slice: &[Vec<B>]) {
88-
for item in slice {
89-
self.copy_push(item);
90-
}
91-
}
9287
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
9388
for index in start .. end {
9489
self.copy(other.index(index));
@@ -103,8 +98,6 @@ where
10398
stats: Default::default(),
10499
}
105100
}
106-
fn reserve(&mut self, _additional: usize) {
107-
}
108101
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
109102

110103
if cont1.len() > 0 { cont1.print(); }

src/trace/implementations/mod.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,6 @@ impl BatchContainer for OffsetList {
290290
self.push(item.0);
291291
}
292292

293-
fn copy_slice(&mut self, slice: &[Self::PushItem]) {
294-
for index in slice {
295-
self.push(*index);
296-
}
297-
}
298-
299293
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
300294
for offset in start..end {
301295
self.push(other.index(offset));
@@ -306,10 +300,6 @@ impl BatchContainer for OffsetList {
306300
Self::with_capacity(size)
307301
}
308302

309-
fn reserve(&mut self, _additional: usize) {
310-
// Nop
311-
}
312-
313303
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
314304
Self::with_capacity(cont1.len() + cont2.len())
315305
}
@@ -347,14 +337,10 @@ pub mod containers {
347337
fn copy_push(&mut self, item: &Self::PushItem);
348338
/// Inserts a borrowed item.
349339
fn copy(&mut self, item: Self::ReadItem<'_>);
350-
/// Extends from a slice of items.
351-
fn copy_slice(&mut self, slice: &[Self::PushItem]);
352340
/// Extends from a range of items in another`Self`.
353341
fn copy_range(&mut self, other: &Self, start: usize, end: usize);
354342
/// Creates a new container with sufficient capacity.
355343
fn with_capacity(size: usize) -> Self;
356-
/// Reserves additional capacity.
357-
fn reserve(&mut self, additional: usize);
358344
/// Creates a new container with sufficient capacity.
359345
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self;
360346

@@ -432,18 +418,12 @@ pub mod containers {
432418
fn copy(&mut self, item: &T) {
433419
self.push(item.clone());
434420
}
435-
fn copy_slice(&mut self, slice: &[T]) {
436-
self.extend_from_slice(slice);
437-
}
438421
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
439422
self.extend_from_slice(&other[start .. end]);
440423
}
441424
fn with_capacity(size: usize) -> Self {
442425
Vec::with_capacity(size)
443426
}
444-
fn reserve(&mut self, additional: usize) {
445-
self.reserve(additional);
446-
}
447427
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
448428
Vec::with_capacity(cont1.len() + cont2.len())
449429
}
@@ -470,12 +450,6 @@ pub mod containers {
470450
fn copy(&mut self, item: &T) {
471451
self.copy(item);
472452
}
473-
fn copy_slice(&mut self, slice: &[Self::PushItem]) {
474-
self.reserve_items(slice.iter());
475-
for item in slice.iter() {
476-
self.copy(item);
477-
}
478-
}
479453
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
480454
let slice = &other[start .. end];
481455
self.reserve_items(slice.iter());
@@ -486,8 +460,6 @@ pub mod containers {
486460
fn with_capacity(size: usize) -> Self {
487461
Self::with_capacity(size)
488462
}
489-
fn reserve(&mut self, _additional: usize) {
490-
}
491463
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
492464
let mut new = Self::default();
493465
new.reserve_regions(std::iter::once(cont1).chain(std::iter::once(cont2)));
@@ -533,11 +505,6 @@ pub mod containers {
533505
}
534506
self.offsets.push(self.inner.len());
535507
}
536-
fn copy_slice(&mut self, slice: &[Vec<B>]) {
537-
for item in slice {
538-
self.copy(item);
539-
}
540-
}
541508
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
542509
for index in start .. end {
543510
self.copy(other.index(index));
@@ -551,8 +518,6 @@ pub mod containers {
551518
inner: Vec::with_capacity(size),
552519
}
553520
}
554-
fn reserve(&mut self, _additional: usize) {
555-
}
556521
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
557522
let mut offsets = Vec::with_capacity(cont1.inner.len() + cont2.inner.len() + 1);
558523
offsets.push(0);
@@ -640,8 +605,6 @@ pub mod containers {
640605
}
641606
}
642607
}
643-
644-
645608

646609
impl<B> BatchContainer for SliceContainer2<B>
647610
where
@@ -664,11 +627,6 @@ pub mod containers {
664627
}
665628
self.offsets.push(self.inner.len());
666629
}
667-
fn copy_slice(&mut self, slice: &[Vec<B>]) {
668-
for item in slice {
669-
self.copy_push(item);
670-
}
671-
}
672630
fn copy_range(&mut self, other: &Self, start: usize, end: usize) {
673631
for index in start .. end {
674632
self.copy(other.index(index));
@@ -683,8 +641,6 @@ pub mod containers {
683641
inner: Vec::with_capacity(size),
684642
}
685643
}
686-
fn reserve(&mut self, _additional: usize) {
687-
}
688644
fn merge_capacity(cont1: &Self, cont2: &Self) -> Self {
689645
let mut offsets = Vec::with_capacity(cont1.inner.len() + cont2.inner.len() + 1);
690646
offsets.push(0);

0 commit comments

Comments
 (0)