Refine function call parameters size.

This commit is contained in:
Stephen Chung
2020-10-12 17:00:58 +08:00
parent c4f00afbee
commit 21b989afd5
3 changed files with 69 additions and 75 deletions

View File

@@ -420,7 +420,7 @@ impl<'a> Scope<'a> {
/// Clone the Scope, keeping only the last instances of each variable name.
/// Shadowed variables are omitted in the copy.
#[inline]
pub(crate) fn flatten_clone(&self) -> Self {
pub(crate) fn clone_visible(&self) -> Self {
let mut entries: Vec<Entry> = Default::default();
self.0.iter().rev().for_each(|entry| {
@@ -488,6 +488,12 @@ impl<'a> Scope<'a> {
}| { (name.as_ref(), typ.is_constant(), value) },
)
}
/// Get a mutable iterator to entries in the Scope.
#[inline(always)]
pub(crate) fn iter_mut(&mut self) -> impl Iterator<Item = &mut Entry<'a>> {
self.0.iter_mut()
}
}
impl<'a, K: Into<Cow<'a, str>>> iter::Extend<(K, EntryType, Dynamic)> for Scope<'a> {