1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

remove string clone because cJSON already did internally

This commit is contained in:
S-YOU 2020-01-19 01:40:58 +09:00 committed by Alexander Medvednikov
parent a9127bedf7
commit 09e390eac5

View File

@ -165,9 +165,7 @@ fn jsencode_bool(val bool) &C.cJSON {
} }
fn jsencode_string(val string) &C.cJSON { fn jsencode_string(val string) &C.cJSON {
clone := val.clone() return C.cJSON_CreateString(val.str)
return C.cJSON_CreateString(clone.str)
// return C.cJSON_CreateString2(val.str, val.len)
} }
// /////////////////////// // ///////////////////////
// user := decode_User(json_parse(js_string_var)) // user := decode_User(json_parse(js_string_var))