Use minimum limit as initial table size (#196)

This commit is contained in:
Brandon Fish
2019-02-22 13:16:15 -06:00
committed by Mackenzie Clark
parent a6d72bdec9
commit c9969f269c
4 changed files with 38 additions and 5 deletions

View File

@ -53,10 +53,7 @@ impl AnyfuncTable {
desc: TableDescriptor,
local: &mut vm::LocalTable,
) -> Result<Box<Self>, CreationError> {
let initial_table_backing_len = match desc.maximum {
Some(max) => max,
None => desc.minimum,
} as usize;
let initial_table_backing_len = desc.minimum as usize;
let mut storage = Box::new(AnyfuncTable {
backing: vec![vm::Anyfunc::null(); initial_table_backing_len],