diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-06-06 18:03:51 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-06-06 18:03:51 +0200 |
commit | 210955c3b6bfbb1d27c426f78cd9315bab2dd0ec (patch) | |
tree | 03b37268667ee2db75ba0fffcb3b3954301f8586 /lib/pure | |
parent | 0915399b5008eeec9ea8f3dbf0122c98f2055de7 (diff) | |
parent | f603e1b268659085b8b9e51d55e78217bfe2e3c3 (diff) | |
download | Nim-210955c3b6bfbb1d27c426f78cd9315bab2dd0ec.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/collections/tables.nim | 7 | ||||
-rw-r--r-- | lib/pure/concurrency/cpuinfo.nim | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 323af5a38..5b6701a12 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -590,8 +590,11 @@ proc enlarge[A, B](t: var OrderedTable[A, B]) = swap(t.data, n) while h >= 0: var nxt = n[h].next - if isFilled(n[h].hcode): - var j = -1 - rawGetKnownHC(t, n[h].key, n[h].hcode) + let eh = n[h].hcode + if isFilled(eh): + var j: Hash = eh and maxHash(t) + while isFilled(t.data[j].hcode): + j = nextTry(j, maxHash(t)) rawInsert(t, t.data, n[h].key, n[h].val, n[h].hcode, j) h = nxt diff --git a/lib/pure/concurrency/cpuinfo.nim b/lib/pure/concurrency/cpuinfo.nim index c3390573a..603fee080 100644 --- a/lib/pure/concurrency/cpuinfo.nim +++ b/lib/pure/concurrency/cpuinfo.nim @@ -69,4 +69,4 @@ proc countProcessors*(): int {.rtl, extern: "ncpi$1".} = result = affinitySpaceTotal().int else: result = sysconf(SC_NPROCESSORS_ONLN) - if result <= 0: result = 1 + if result <= 0: result = 0 |