summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-05 10:11:46 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-03-05 10:11:46 -0800
commit57ee9921068282f47c0ed91e53a0923e6f08e6e4 (patch)
tree2843c7d87271b318dcca553aab92802a8a1b2b90 /hash.c
parent2c2ac2df58dced80405c6f3a4d2e4ca0df989a02 (diff)
downloadtxr-57ee9921068282f47c0ed91e53a0923e6f08e6e4.tar.gz
txr-57ee9921068282f47c0ed91e53a0923e6f08e6e4.tar.bz2
txr-57ee9921068282f47c0ed91e53a0923e6f08e6e4.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.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hash.c b/hash.c
index 9b1d4b46..c9aa5b6a 100644
--- a/hash.c
+++ b/hash.c
@@ -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;