diff options
author | Petri Lehtinen <petri@digip.org> | 2010-01-10 14:39:04 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2010-01-10 14:39:11 +0200 |
commit | 508873de9bad7019872857c7aa031570f6c1f205 (patch) | |
tree | 7cf46b5330e8bdd6635b7203cf967cd6c06736b4 /src | |
parent | 9db34dc31a69312ec1f486e6273d1bf5c80f978d (diff) | |
download | jansson-508873de9bad7019872857c7aa031570f6c1f205.zip jansson-508873de9bad7019872857c7aa031570f6c1f205.tar.gz jansson-508873de9bad7019872857c7aa031570f6c1f205.tar.bz2 |
Use _nocheck functions internally for speed
There are some places where we copy a string from an existing JSON
value. In these cases the string has already been checked for valid
UTF-8.
Diffstat (limited to 'src')
-rw-r--r-- | src/value.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/value.c b/src/value.c index 2b97947..e118af1 100644 --- a/src/value.c +++ b/src/value.c @@ -170,7 +170,7 @@ int json_object_update(json_t *object, json_t *other) key = json_object_iter_key(iter); value = json_object_iter_value(iter); - if(json_object_set(object, key, value)) + if(json_object_set_nocheck(object, key, value)) return -1; iter = json_object_iter_next(other, iter); @@ -260,7 +260,7 @@ static json_t *json_object_copy(json_t *object) key = json_object_iter_key(iter); value = json_object_iter_value(iter); - json_object_set(result, key, value); + json_object_set_nocheck(result, key, value); iter = json_object_iter_next(object, iter); } @@ -285,7 +285,7 @@ static json_t *json_object_deep_copy(json_t *object) key = json_object_iter_key(iter); value = json_object_iter_value(iter); - json_object_set(result, key, json_deep_copy(value)); + json_object_set_nocheck(result, key, json_deep_copy(value)); iter = json_object_iter_next(object, iter); } @@ -667,7 +667,7 @@ static int json_string_equal(json_t *string1, json_t *string2) static json_t *json_string_copy(json_t *string) { - return json_string(json_string_value(string)); + return json_string_nocheck(json_string_value(string)); } |