mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Inline small stdlib functions (#71)
This commit is contained in:
@ -8,6 +8,7 @@ import {
|
||||
} from "../array";
|
||||
|
||||
/** Obtains the default comparator for the specified type. */
|
||||
@inline
|
||||
export function defaultComparator<T>(): (a: T, b: T) => i32 {
|
||||
return (a: T, b: T): i32 => (<i32>(a > b) - <i32>(a < b)); // compiles to a constant table index
|
||||
}
|
||||
|
Reference in New Issue
Block a user