diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-05 10:11:46 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-05 10:11:46 -0800 |
commit | fe1a6af2360e9c7aac512680f04c5df7a9492623 (patch) | |
tree | 2843c7d87271b318dcca553aab92802a8a1b2b90 | |
parent | 85190e9519fcd930728571af637324edcf478762 (diff) | |
download | txr-fe1a6af2360e9c7aac512680f04c5df7a9492623.tar.gz txr-fe1a6af2360e9c7aac512680f04c5df7a9492623.tar.bz2 txr-fe1a6af2360e9c7aac512680f04c5df7a9492623.zip |
streamline default alg handling in group-reduce.
* hash.c (group_reduce): Don't pointlessly default filter_fun to
identity_f, and then check for that value and not use it.
Just skip the filtering code if the argument is missing.
-rw-r--r-- | hash.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -1086,7 +1086,6 @@ val group_reduce(val hash, val by_fun, val reduce_fun, val seq, val initval, val filter_fun) { initval = default_bool_arg(initval); - filter_fun = default_arg(filter_fun, identity_f); if (vectorp(seq)) { cnum i, len; @@ -1116,7 +1115,7 @@ val group_reduce(val hash, val by_fun, val reduce_fun, val seq, } } - if (filter_fun != identity_f) { + if (!null_or_missing_p(filter_fun)) { val iter = hash_begin(hash); val cell; |