Refine data structures.

This commit is contained in:
Stephen Chung
2022-05-07 15:54:44 +08:00
parent fc64e93b93
commit 4194e2c048
8 changed files with 59 additions and 41 deletions

View File

@@ -13,8 +13,7 @@ pub struct FnResolutionCacheEntry {
/// Function.
pub func: CallableFunction,
/// Optional source.
/// No source if the string is empty.
pub source: Identifier,
pub source: Option<Box<Identifier>>,
}
/// _(internals)_ A function resolution cache.
@@ -22,7 +21,7 @@ pub struct FnResolutionCacheEntry {
///
/// [`FnResolutionCacheEntry`] is [`Box`]ed in order to pack as many entries inside a single B-Tree
/// level as possible.
pub type FnResolutionCache = BTreeMap<u64, Option<Box<FnResolutionCacheEntry>>>;
pub type FnResolutionCache = BTreeMap<u64, Option<FnResolutionCacheEntry>>;
/// _(internals)_ A type containing system-wide caches.
/// Exported under the `internals` feature only.