From b4735f25eaa42e2af3538d14a90aaa24ba0650ea Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Sat, 25 Mar 2023 16:00:07 +0000 Subject: [PATCH] Minor tweaks --- std/algorithm/searching.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/std/algorithm/searching.d b/std/algorithm/searching.d index 1aceda40d60..19a0c626a4f 100644 --- a/std/algorithm/searching.d +++ b/std/algorithm/searching.d @@ -3862,7 +3862,9 @@ if (isInputRange!Range && !isInfinite!Range && } /** Returns an array of the minimum and maximum element in `r`. - * Makes `< 3n/2` comparisons. + * Performs `< 3n/2` comparisons, unlike the naive `< 2n`. + * Params: + * r = The range to traverse. */ // TODO alias map = a => a ElementType!Range[2] extrema(Range)(Range r) @@ -3915,7 +3917,7 @@ unittest assert(extrema([2,3,3,2]) == [2, 3]); version (StdRandomTests) - foreach (i; 0..1000) + foreach (i; 0 .. 1000) { import std.random, std.range; auto arr = generate!(() => uniform(0, 100)).takeExactly(uniform(1, 10)).array;