mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 12:11:50 +00:00
Inline isNaN and isFinite
Looking at our existing tests it seems that inlining these can be performed by reusing locals most of the time, and sometimes enables erasing quite a bit of unnecessary code when optimizing.
This commit is contained in:
@ -12,8 +12,8 @@
|
||||
@builtin export declare function isArray<T>(value?: T): bool;
|
||||
@builtin export declare function isDefined(expression: void): bool;
|
||||
@builtin export declare function isConstant(expression: void): bool;
|
||||
export function isNaN<T>(value: T): bool { return value != value; }
|
||||
export function isFinite<T>(value: T): bool { return value - value == 0; }
|
||||
@inline export function isNaN<T>(value: T): bool { return value != value; }
|
||||
@inline export function isFinite<T>(value: T): bool { return value - value == 0; }
|
||||
|
||||
@builtin export declare function clz<T>(value: T): T;
|
||||
@builtin export declare function ctz<T>(value: T): T;
|
||||
|
Reference in New Issue
Block a user