From ea752f29a0fd03552d49b1473b52de91b148765e Mon Sep 17 00:00:00 2001 From: narimiran Date: Sun, 22 Oct 2017 13:43:45 +0200 Subject: [PATCH] more descriptive names --- lib/pure/collections/sequtils.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim index 3e49d09821..0cc367fa70 100644 --- a/lib/pure/collections/sequtils.nim +++ b/lib/pure/collections/sequtils.nim @@ -43,8 +43,8 @@ proc concat*[T](seqs: varargs[seq[T]]): seq[T] = result[i] = itm inc(i) -proc count*[T](s: seq[T], x: T): int = - ## Count the occurrences of the item `x` in the sequence `s`. +proc count*[T](list: seq[T], item: T): int = + ## Count the occurrences of the item `item` in the sequence `list`. ## ## Example: ## @@ -53,8 +53,8 @@ proc count*[T](s: seq[T], x: T): int = ## s = @[1, 2, 2, 3, 2, 4, 2] ## c = count(s, 2) ## assert c == 4 - for itm in items(s): - if itm == x: + for x in items(list): + if x == item: inc result proc cycle*[T](s: seq[T], n: Natural): seq[T] =