Skip to content

Commit

Permalink
Microoptimizes isnum_safe() (#3055)
Browse files Browse the repository at this point in the history
  • Loading branch information
ike709 committed Dec 1, 2020
1 parent 1255b41 commit d2b0c1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,4 +264,4 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(
#define isinf(x) (isnum((x)) && (((x) == text2num("inf")) || ((x) == text2num("-inf"))))

/// NaN isn't a number, damn it. Infinity is a problem too.
#define isnum_safe(x) ( isnum((x)) && !isnan((x)) && !isinf((x)) )
#define isnum_safe(x) ( isnum((x)) && (x) == (x) && !isinf((x)) )

0 comments on commit d2b0c1e

Please sign in to comment.