Replace StaticVec with SmallVec.

This commit is contained in:
Stephen Chung
2020-07-29 16:10:06 +08:00
parent 40850e6b1e
commit afbcd0fc0b
7 changed files with 54 additions and 587 deletions

View File

@@ -20,6 +20,7 @@ use crate::parser::CustomExpr;
use crate::stdlib::{
boxed::Box,
iter::empty,
mem,
string::{String, ToString},
vec,
vec::Vec,
@@ -436,7 +437,7 @@ fn optimize_expr(expr: Expr, state: &mut State) -> Expr {
// Array literal where everything is pure - promote the indexed item.
// All other items can be thrown away.
state.set_dirty();
let mut expr = a.0.take(i.0 as usize);
let mut expr = a.0.remove(i.0 as usize);
expr.set_position(a.1);
expr
}