mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
migrate remaining code to the new maps
This commit is contained in:
parent
f7dbbf5810
commit
3b1964e9df
@ -26,10 +26,7 @@ fn main() {
|
||||
m[key] = m[key] + 1// TODO m[key]++
|
||||
}
|
||||
// Sort the keys
|
||||
mut keys := []string
|
||||
for e in m.entries {
|
||||
keys << e.key
|
||||
}
|
||||
mut keys := m.keys()
|
||||
keys.sort()
|
||||
// Print the map
|
||||
for key in keys {
|
||||
|
@ -202,7 +202,7 @@ pub fn (m map_string) str() string {
|
||||
}
|
||||
// TODO use bytes buffer
|
||||
mut s := '{\n'
|
||||
//for entry in m.entries {
|
||||
//for key, val in m {
|
||||
//val := m[entry.key]
|
||||
//s += ' "$entry.key" => "$val"\n'
|
||||
//}
|
||||
|
@ -124,9 +124,7 @@ fn (req &Request) do() Response {
|
||||
// Add request headers
|
||||
mut hlist := &C.curl_slist{!}
|
||||
// for i, h := range req.headers {
|
||||
for entry in req.headers.entries {
|
||||
key := entry.key
|
||||
val := req.headers[key]
|
||||
for key, val in req.headers {
|
||||
h := '$key: $val'
|
||||
hlist = C.curl_slist_append(hlist, h.cstr())
|
||||
}
|
||||
|
@ -42,10 +42,7 @@ fn (req &Request) do() Response {
|
||||
mut headers := ''
|
||||
mut resp_headers := ''
|
||||
// for header in req.headers {
|
||||
for entry in req.headers.entries {
|
||||
// headers += '$header\r\n'
|
||||
key := entry.key
|
||||
val := req.headers[key]
|
||||
for key, val in req.headers {
|
||||
headers += '$key: $val\r\n'
|
||||
}
|
||||
if req.typ == 'POST' {
|
||||
|
Loading…
Reference in New Issue
Block a user