diff options
Diffstat (limited to 'lib/pure')
-rwxr-xr-x | lib/pure/strtabs.nim | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/pure/strtabs.nim b/lib/pure/strtabs.nim index fda0740d3..8be66dee9 100755 --- a/lib/pure/strtabs.nim +++ b/lib/pure/strtabs.nim @@ -142,18 +142,19 @@ proc newStringTable*(mode: TStringTableMode): PStringTable {. result.counter = 0 newSeq(result.data, startSize) -proc newStringTable*(keyValuePairs: openarray[string], - mode: TStringTableMode = modeCaseSensitive): PStringTable {. - rtl, extern: "nst$1WithPairs".} = - ## creates a new string table with given key value pairs. - ## Example:: - ## var mytab = newStringTable("key1", "val1", "key2", "val2", - ## modeCaseInsensitive) - result = newStringTable(mode) - var i = 0 - while i < high(keyValuePairs): - result[keyValuePairs[i]] = keyValuePairs[i + 1] - inc(i, 2) +when false: + proc newStringTable(keyValuePairs: openarray[string], + mode = modeCaseSensitive): PStringTable {. + rtl, extern: "nst$1WithPairs".} = + ## creates a new string table with given key value pairs. + ## Example:: + ## var mytab = newStringTable("key1", "val1", "key2", "val2", + ## modeCaseInsensitive) + result = newStringTable(mode) + var i = 0 + while i < high(keyValuePairs): + result[keyValuePairs[i]] = keyValuePairs[i + 1] + inc(i, 2) proc newStringTable*(keyValuePairs: openarray[tuple[key, val: string]], mode: TStringTableMode = modeCaseSensitive): PStringTable {. |