* fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
This commit is contained in:
parent
7dc80a7fef
commit
8a19ac2070
11 changed files with 70 additions and 61 deletions
|
|
@ -83,7 +83,8 @@ proc shrink*[T](x: var seq[T]; newLen: Natural) {.tags: [], raises: [].} =
|
|||
for i in countdown(x.len - 1, newLen):
|
||||
reset x[i]
|
||||
# XXX This is wrong for const seqs that were moved into 'x'!
|
||||
cast[ptr NimSeqV2[T]](addr x).len = newLen
|
||||
{.noSideEffect.}:
|
||||
cast[ptr NimSeqV2[T]](addr x).len = newLen
|
||||
|
||||
proc grow*[T](x: var seq[T]; newLen: Natural; value: T) =
|
||||
let oldLen = x.len
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ proc eqStrings(a, b: string): bool {.inline, compilerproc.} =
|
|||
proc hashString(s: string): int {.compilerproc.} =
|
||||
# the compiler needs exactly the same hash function!
|
||||
# this used to be used for efficient generation of string case statements
|
||||
var h : uint = 0
|
||||
var h = 0'u
|
||||
for i in 0..len(s)-1:
|
||||
h = h + uint(s[i])
|
||||
h = h + h shl 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue