From f7e0387b6dd2b3c63e0c3ef4ee4e0c49810d93ec Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 22 Feb 2012 17:37:56 +0200 Subject: [PATCH] std.algorithm: Fix the documentation of remove with pred The description contradicted the example/unittest/actual behavior. --- std/algorithm.d | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/std/algorithm.d b/std/algorithm.d index 144d24f3c..f2f027fc8 100644 --- a/std/algorithm.d +++ b/std/algorithm.d @@ -6078,18 +6078,17 @@ unittest } /** -Reduces the length of the bidirectional range $(D range) by only -keeping elements that satisfy $(D pred). If $(D s = -SwapStrategy.unstable), elements are moved from the right end of the -range over the elements to eliminate. If $(D s = SwapStrategy.stable) -(the default), elements are moved progressively to front such that -their relative order is preserved. Returns the tail portion of the -range that was moved. +Reduces the length of the bidirectional range $(D range) by removing +elements that satisfy $(D pred). If $(D s = SwapStrategy.unstable), +elements are moved from the right end of the range over the elements +to eliminate. If $(D s = SwapStrategy.stable) (the default), +elements are moved progressively to front such that their relative +order is preserved. Returns the filtered range. Example: ---- int[] a = [ 1, 2, 3, 2, 3, 4, 5, 2, 5, 6 ]; -assert(a[0 .. remove!("a == 2")(a).length] == [ 1, 3, 3, 4, 5, 5, 6 ]); +assert(remove!("a == 2")(a) == [ 1, 3, 3, 4, 5, 5, 6 ]); ---- */ Range remove(alias pred, SwapStrategy s = SwapStrategy.stable, Range)