Added __ prefix to get_key function used in parse_meminfo

master
Ronald1985 2 years ago
parent 7d7e75ee82
commit fd7f273290

@ -62,7 +62,7 @@ get_hostname :: proc() -> (string, bool) {
return hostname, ok return hostname, ok
} }
get_key :: proc(s: string) -> (string, bool) { __get_key :: proc(s: string) -> (string, bool) {
if len(s) > 1 && s[len(s) - 1] == ':' { if len(s) > 1 && s[len(s) - 1] == ':' {
// Yes, this ends in a colon and is a key // Yes, this ends in a colon and is a key
return s[:len(s) - 1], true return s[:len(s) - 1], true
@ -80,7 +80,7 @@ parse_meminfo :: proc(meminfo: string) -> (map[string]f64, bool) {
last_key := "" last_key := ""
for len(s) > 0 { for len(s) > 0 {
key, key_ok := get_key(s[0]) key, key_ok := __get_key(s[0])
if !key_ok { if !key_ok {
// Must've been a suffix, so let's multiply the last value // Must've been a suffix, so let's multiply the last value
switch key { switch key {

Loading…
Cancel
Save