Inline small stdlib functions (#71)

This commit is contained in:
Max Graey
2018-04-12 15:17:30 +03:00
committed by Daniel Wirtz
parent 5b97427bfa
commit 2002e32c9c
8 changed files with 841 additions and 910 deletions

View File

@ -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
}