Use tokens to speed up function name lookup.
This commit is contained in:
@@ -668,6 +668,12 @@ mod range_functions {
|
||||
pub fn is_empty_exclusive(range: &mut ExclusiveRange) -> bool {
|
||||
range.is_empty()
|
||||
}
|
||||
/// Return `true` if the range contains a specified value.
|
||||
#[rhai_fn(name = "contains")]
|
||||
pub fn contains_exclusive(range: &mut ExclusiveRange, value: INT) -> bool {
|
||||
range.contains(&value)
|
||||
}
|
||||
|
||||
/// Return the start of the inclusive range.
|
||||
#[rhai_fn(get = "start", name = "start", pure)]
|
||||
pub fn start_inclusive(range: &mut InclusiveRange) -> INT {
|
||||
@@ -695,4 +701,9 @@ mod range_functions {
|
||||
pub fn is_empty_inclusive(range: &mut InclusiveRange) -> bool {
|
||||
range.is_empty()
|
||||
}
|
||||
/// Return `true` if the range contains a specified value.
|
||||
#[rhai_fn(name = "contains")]
|
||||
pub fn contains_inclusive(range: &mut InclusiveRange, value: INT) -> bool {
|
||||
range.contains(&value)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user