From f6c4864f9fe2c4b8fdd874c4f55c2c38c36d476f Mon Sep 17 00:00:00 2001 From: def Date: Sat, 28 Jun 2014 14:38:48 +0200 Subject: [PATCH] Rename keepIfIt to keepItIf --- lib/pure/collections/sequtils.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 8e50b9e204..27e02a5db5 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -270,16 +270,16 @@ template filterIt*(seq1, pred: expr): expr {.immediate.} = if pred: result.add(it) result -template keepIfIt*(varSeq, pred: expr) = +template keepItIf*(varSeq, pred: expr) = ## Convenience template around the ``keepIf`` proc to reduce typing. ## ## Unlike the `proc` version, the predicate needs to be an expression using - ## the ``it`` variable for testing, like: ``keepIfIt("abcxyz", it == 'x')``. + ## the ``it`` variable for testing, like: ``keepItIf("abcxyz", it == 'x')``. ## Example: ## ## .. code-block:: nimrod ## var candidates = @["foo", "bar", "baz", "foobar"] - ## keepIfIt(candidates, it.len == 3 and it[0] == 'b') + ## keepItIf(candidates, it.len == 3 and it[0] == 'b') ## assert candidates == @["bar", "baz"] var pos = 0 for i in 0 ..