Use std HashMap to simplify API

This commit is contained in:
Dirkjan Ochtman 2021-02-04 10:16:38 +01:00
parent c1068c2e53
commit 970caeba44
1 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,6 @@
use std::ops::{Index, Range};
use std::str;
use ahash::AHashMap as HashMap;
use smartstring::alias::String;
#[cfg(feature = "__test_data")]
@ -86,7 +85,7 @@ impl<'a> SegmentState<'a> {
Self {
data,
text,
memo: HashMap::new(),
memo: HashMap::default(),
split_cache: Vec::new(),
result,
best: vec![vec![]; SEGMENT_SIZE],
@ -186,6 +185,8 @@ impl Index<Range<usize>> for Ascii {
}
}
type HashMap<K, V> = std::collections::HashMap<K, V, ahash::RandomState>;
const DEFAULT_LIMIT: usize = 24;
const DEFAULT_TOTAL: f64 = 1_024_908_267_229.0;
const SEGMENT_SIZE: usize = 250;