feat: use hashbrown
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
extern crate test;
|
||||
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use inkwell::context::Context;
|
||||
use test::{Bencher, black_box};
|
||||
|
||||
use ecow::EcoString;
|
||||
use rpds::{ht_map, vector_sync};
|
||||
use rpds::vector_sync;
|
||||
|
||||
use crate::compile::compile;
|
||||
use crate::ir::downgrade;
|
||||
@@ -24,6 +26,19 @@ fn test_expr(expr: &str, expected: Value) {
|
||||
assert_eq!(run(prog, jit).unwrap(), expected);
|
||||
}
|
||||
|
||||
macro_rules! map {
|
||||
($($k:expr => $v:expr),*) => {
|
||||
{
|
||||
#[allow(unused_mut)]
|
||||
let mut m = HashMap::new();
|
||||
$(
|
||||
m.insert($k, $v);
|
||||
)*
|
||||
m
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! thunk {
|
||||
() => {
|
||||
Value::Thunk
|
||||
@@ -68,7 +83,7 @@ macro_rules! list {
|
||||
|
||||
macro_rules! attrs {
|
||||
($($x:tt)*) => (
|
||||
Value::AttrSet(AttrSet::new(ht_map!{$($x)*}))
|
||||
Value::AttrSet(AttrSet::new(map!{$($x)*}))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user