@@ -446,35 +446,21 @@ if (fun.length >= 1)
446446 auto map (Range )(Range r)
447447 if (isInputRange! (Unqual! Range ))
448448 {
449- import std.meta : AliasSeq, staticMap;
449+ import std.meta : staticMap;
450+ import std.functional : adjoin;
450451
451452 alias RE = ElementType! (Range );
452- static if (fun.length > 1 )
453- {
454- import std.functional : adjoin;
455- import std.meta : staticIndexOf;
456453
457- alias _funs = staticMap! (unaryFun, fun);
458- alias _fun = adjoin! _funs;
454+ alias _funs = staticMap! (unaryFun, fun);
455+ alias _fun = adjoin! _funs;
459456
460- // Once https://issues.dlang.org/show_bug.cgi?id=5710 is fixed
461- // accross all compilers (as of 2020-04, it wasn't fixed in LDC and GDC),
462- // this validation loop can be moved into a template.
463- foreach (f; _funs)
464- {
465- static assert (! is (typeof (f(RE .init)) == void ),
466- " Mapping function(s) must not return void: " ~ _funs.stringof);
467- }
468- }
469- else
457+ // Once https://issues.dlang.org/show_bug.cgi?id=5710 is fixed
458+ // accross all compilers (as of 2020-04, it wasn't fixed in LDC and GDC),
459+ // this validation loop can be moved into a template.
460+ foreach (f; _funs)
470461 {
471- alias _fun = unaryFun! fun;
472- alias _funs = AliasSeq! (_fun);
473-
474- // Do the validation separately for single parameters due to
475- // https://issues.dlang.org/show_bug.cgi?id=15777.
476- static assert (! is (typeof (_fun(RE .init)) == void ),
477- " Mapping function(s) must not return void: " ~ _funs.stringof);
462+ static assert (! is (typeof (f(RE .init)) == void ),
463+ " Mapping function(s) must not return void: " ~ _funs.stringof);
478464 }
479465
480466 return MapResult! (_fun, Range )(r);
0 commit comments