alternative, much simpler algorithm for strict func checking (#21066)
* alternative, much simpler algorithm for strict func checking * forgot to git add new compiler module * new spec is incredibly simple to describe * fixes bigints regression * typos * closes #16305; closes #17387; closes #20863
This commit is contained in:
parent
c7493bbdd0
commit
3812d91390
14 changed files with 187 additions and 78 deletions
|
|
@ -132,17 +132,13 @@ func toCaseInsensitive(headers: HttpHeaders, s: string): string {.inline.} =
|
|||
func newHttpHeaders*(titleCase=false): HttpHeaders =
|
||||
## Returns a new `HttpHeaders` object. if `titleCase` is set to true,
|
||||
## headers are passed to the server in title case (e.g. "Content-Length")
|
||||
new result
|
||||
result.table = newTable[string, seq[string]]()
|
||||
result.isTitleCase = titleCase
|
||||
result = HttpHeaders(table: newTable[string, seq[string]](), isTitleCase: titleCase)
|
||||
|
||||
func newHttpHeaders*(keyValuePairs:
|
||||
openArray[tuple[key: string, val: string]], titleCase=false): HttpHeaders =
|
||||
## Returns a new `HttpHeaders` object from an array. if `titleCase` is set to true,
|
||||
## headers are passed to the server in title case (e.g. "Content-Length")
|
||||
new result
|
||||
result.table = newTable[string, seq[string]]()
|
||||
result.isTitleCase = titleCase
|
||||
result = HttpHeaders(table: newTable[string, seq[string]](), isTitleCase: titleCase)
|
||||
|
||||
for pair in keyValuePairs:
|
||||
let key = result.toCaseInsensitive(pair.key)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue