diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-07 19:29:28 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-07 19:29:28 -0700 |
commit | ed104dd48299712450c289908ec43f6e49468959 (patch) | |
tree | cbd36fd846b218c10b53fc1fb864d2b9e99431f5 /lib.h | |
parent | 85e80eb7f9dcc3e24b8a2d618525a4ce901d3982 (diff) | |
download | txr-ed104dd48299712450c289908ec43f6e49468959.tar.gz txr-ed104dd48299712450c289908ec43f6e49468959.tar.bz2 txr-ed104dd48299712450c289908ec43f6e49468959.zip |
Avoid unnecessary evaluation in argument defaulting.
* lib.h (default_arg): Inline function becomes macro,
so we can avoid evaluating the default value expression
when it is not needed.
* lib.c (default_arg): Declaration removed.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -1024,10 +1024,7 @@ INLINE int null_or_missing_p(val v) { return (nilp(v) || missingp(v)); } #define tnil(c_cond) ((c_cond) ? t : nil) -INLINE val default_arg(val arg, val dfl) -{ - return if3(null_or_missing_p(arg), dfl, arg); -} +#define default_arg(arg, dfl) if3(null_or_missing_p(arg), dfl, arg) INLINE val default_bool_arg(val arg) { |