remove annoying messages when creating orderedTables (#15309)
* nativesockets docs minor [backport: 1.2] * remove annoying messages
This commit is contained in:
parent
5f08d39398
commit
a41b243fea
1 changed files with 11 additions and 11 deletions
|
|
@ -1784,7 +1784,7 @@ proc newOrderedTable*[A, B](pairs: openArray[(A, B)]): <//>OrderedTableRef[A, B]
|
||||||
assert b == {'a': 5, 'b': 9}.newOrderedTable
|
assert b == {'a': 5, 'b': 9}.newOrderedTable
|
||||||
|
|
||||||
result = newOrderedTable[A, B](pairs.len)
|
result = newOrderedTable[A, B](pairs.len)
|
||||||
for key, val in items(pairs): result.add(key, val)
|
for key, val in items(pairs): result[key] = val
|
||||||
|
|
||||||
|
|
||||||
proc `[]`*[A, B](t: OrderedTableRef[A, B], key: A): var B =
|
proc `[]`*[A, B](t: OrderedTableRef[A, B], key: A): var B =
|
||||||
|
|
@ -2967,37 +2967,37 @@ when isMainModule:
|
||||||
block: #5482
|
block: #5482
|
||||||
var a = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
var a = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
||||||
var b = newOrderedTable[string, string](initialSize = 2)
|
var b = newOrderedTable[string, string](initialSize = 2)
|
||||||
b.add("wrong?", "foo")
|
b["wrong?"] = "foo"
|
||||||
b.add("wrong?", "foo2")
|
b["wrong?"] = "foo2"
|
||||||
assert a == b
|
assert a == b
|
||||||
|
|
||||||
block: #5482
|
block: #5482
|
||||||
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
||||||
var b = newOrderedTable[string, string](initialSize = 2)
|
var b = newOrderedTable[string, string](initialSize = 2)
|
||||||
b.add("wrong?", "foo")
|
b["wrong?"] = "foo"
|
||||||
b.add("wrong?", "foo2")
|
b["wrong?"] = "foo2"
|
||||||
assert a == b
|
assert a == b
|
||||||
|
|
||||||
block: #5487
|
block: #5487
|
||||||
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
||||||
var b = newOrderedTable[string, string]() # notice, default size!
|
var b = newOrderedTable[string, string]() # notice, default size!
|
||||||
b.add("wrong?", "foo")
|
b["wrong?"] = "foo"
|
||||||
b.add("wrong?", "foo2")
|
b["wrong?"] = "foo2"
|
||||||
assert a == b
|
assert a == b
|
||||||
|
|
||||||
block: #5487
|
block: #5487
|
||||||
var a = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
var a = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
||||||
var b = newOrderedTable[string, string]() # notice, default size!
|
var b = newOrderedTable[string, string]() # notice, default size!
|
||||||
b.add("wrong?", "foo")
|
b["wrong?"] = "foo"
|
||||||
b.add("wrong?", "foo2")
|
b["wrong?"] = "foo2"
|
||||||
assert a == b
|
assert a == b
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
var a = {"wrong?": "foo", "wrong?": "foo2"}.newOrderedTable()
|
||||||
var b = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
var b = [("wrong?", "foo"), ("wrong?", "foo2")].newOrderedTable()
|
||||||
var c = newOrderedTable[string, string]() # notice, default size!
|
var c = newOrderedTable[string, string]() # notice, default size!
|
||||||
c.add("wrong?", "foo")
|
c["wrong?"] = "foo"
|
||||||
c.add("wrong?", "foo2")
|
c["wrong?"] = "foo2"
|
||||||
assert a == b
|
assert a == b
|
||||||
assert a == c
|
assert a == c
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue