style usages part one (openarray => openArray) (#19321)

* style usages (openArray)

* revert doc changes
This commit is contained in:
flywind 2022-01-04 20:29:50 +08:00 • committed by GitHub
commit 9df195ef58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 76 additions and 76 deletions

View file

@ -40,12 +40,12 @@ const msb3999 = mostSignificantBit(3999)
echo msb3999, " ", mostSignificantBit(0), " ", square(44)
proc filter[T](a: openarray[T], predicate: proc (x: T): bool): seq[T] =
proc filter[T](a: openArray[T], predicate: proc (x: T): bool): seq[T] =
result = @[] # @[] constructs the empty seq
for x in a:
if predicate(x): result.add(x)
proc map[T, S](a: openarray[T], fn: proc (x: T): S): seq[S] =
proc map[T, S](a: openArray[T], fn: proc (x: T): S): seq[S] =
newSeq(result, a.len)
for i in 0 ..< a.len: result[i] = fn(a[i])