@@ -259,6 +259,7 @@ reduce_empty(op, T) = _empty_reduce_error()
259
259
reduce_empty (:: typeof (+ ), T) = zero (T)
260
260
reduce_empty (:: typeof (+ ), :: Type{Bool} ) = zero (Int)
261
261
reduce_empty (:: typeof (* ), T) = one (T)
262
+ reduce_empty (:: typeof (* ), :: Type{Char} ) = " "
262
263
reduce_empty (:: typeof (& ), :: Type{Bool} ) = true
263
264
reduce_empty (:: typeof (| ), :: Type{Bool} ) = false
264
265
@@ -303,6 +304,7 @@ The default is `x`.
303
304
"""
304
305
reduce_single (op, x) = x
305
306
reduce_single (:: typeof (+ ), x:: Bool ) = Int (x)
307
+ reduce_single (:: typeof (* ), x:: Char ) = string (x)
306
308
307
309
reduce_single (:: typeof (add_sum), x) = reduce_single (+ , x)
308
310
reduce_single (:: typeof (add_sum), x:: SmallSigned ) = Int (x)
@@ -489,7 +491,7 @@ function mapreduce_impl(f, op::Union{typeof(scalarmax),
489
491
A:: AbstractArray , first:: Int , last:: Int )
490
492
# locate the first non NaN number
491
493
@inbounds a1 = A[first]
492
- v = f ( a1)
494
+ v = mapreduce_single (f, op, a1)
493
495
i = first + 1
494
496
while (v == v) && (i <= last)
495
497
@inbounds ai = A[i]
0 commit comments