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

Switch to using smallvec over tinyvec #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
25 changes: 8 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ required-features = ["ogg"]

[dependencies]
byteorder = "1.0"
tinyvec = { version = "1.0", features = ["alloc"] }
smallvec= { version = "1.0" }
ogg = { version = "0.8", optional = true }
tokio-io = { version = "0.1", optional = true }
futures = { version = "0.1", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::error;
use std::fmt;
use std::cmp::min;
use std::iter;
use tinyvec::TinyVec;
use smallvec::SmallVec;
use crate::ilog;
use bitpacking::BitpackCursor;
use header::{Codebook, Floor, FloorTypeZero, FloorTypeOne,
Expand Down Expand Up @@ -940,7 +940,7 @@ pub fn read_audio_packet_generic<S :Samples>(ident :&IdentHeader, setup :&SetupH
&setup.codebooks, &setup.floors));

// Now calculate the no_residue vector
let mut no_residue = TinyVec::<[bool; 32]>::new();
let mut no_residue = SmallVec::<[bool; 32]>::new();
for fl in &decoded_floor_infos {
no_residue.push(fl.is_unused());
}
Expand All @@ -958,7 +958,7 @@ pub fn read_audio_packet_generic<S :Samples>(ident :&IdentHeader, setup :&SetupH
// Helper variable
let resid_vec_len = (n / 2) as usize;
for (i, &residue_number) in mapping.mapping_submap_residues.iter().enumerate() {
let mut do_not_decode_flag = TinyVec::<[bool; 32]>::new();
let mut do_not_decode_flag = SmallVec::<[bool; 32]>::new();
for (j, &mapping_mux_j) in mapping.mapping_mux.iter().enumerate() {
if mapping_mux_j as usize == i {
do_not_decode_flag.push(no_residue[j]);
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ modules.
*/

extern crate byteorder;
extern crate tinyvec;
extern crate smallvec;
#[cfg(feature = "ogg")]
extern crate ogg;
#[cfg(feature = "async_ogg")]
Expand Down