From 09e390eac5ed6569d52155354cb30da884efaf13 Mon Sep 17 00:00:00 2001 From: S-YOU Date: Sun, 19 Jan 2020 01:40:58 +0900 Subject: [PATCH] remove string clone because cJSON already did internally --- vlib/json/json_primitives.v | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vlib/json/json_primitives.v b/vlib/json/json_primitives.v index 3e19872a48..81cb0ee080 100644 --- a/vlib/json/json_primitives.v +++ b/vlib/json/json_primitives.v @@ -165,9 +165,7 @@ fn jsencode_bool(val bool) &C.cJSON { } fn jsencode_string(val string) &C.cJSON { - clone := val.clone() - return C.cJSON_CreateString(clone.str) - // return C.cJSON_CreateString2(val.str, val.len) + return C.cJSON_CreateString(val.str) } // /////////////////////// // user := decode_User(json_parse(js_string_var))