Add/remove #[inline] attributes.

This commit is contained in:
Stephen Chung
2020-10-08 22:25:50 +08:00
parent e34a370f33
commit 1272eeb81a
31 changed files with 328 additions and 114 deletions

View File

@@ -14,19 +14,15 @@ def_package!(crate:BasicMapPackage:"Basic object map utilities.", lib, {
#[export_module]
mod map_functions {
#[inline(always)]
pub fn has(map: &mut Map, prop: ImmutableString) -> bool {
map.contains_key(&prop)
}
#[inline(always)]
pub fn len(map: &mut Map) -> INT {
map.len() as INT
}
#[inline(always)]
pub fn clear(map: &mut Map) {
map.clear();
}
#[inline(always)]
pub fn remove(x: &mut Map, name: ImmutableString) -> Dynamic {
x.remove(&name).unwrap_or_else(|| ().into())
}