Improved serialization performance (#156)

* Update parson.c

Get objects by index instead of key in json_serialize_to_buffer_r().

* Increments version and updates licence date.

Co-authored-by: Krzysztof Gabis <kgabis@gmail.com>
This commit is contained in:
benswick 2021-04-07 15:23:01 -05:00 committed by GitHub
parent 8beeb5ea4d
commit 60b2c69f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View File

@ -3,7 +3,7 @@ project(parson C)
include (GNUInstallDirs) include (GNUInstallDirs)
set(PARSON_VERSION 1.1.0) set(PARSON_VERSION 1.1.1)
add_library(parson parson.c) add_library(parson parson.c)
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>) target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2012 - 2020 Krzysztof Gabis Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
{ {
"name": "parson", "name": "parson",
"version": "1.1.0", "version": "1.1.1",
"repo": "kgabis/parson", "repo": "kgabis/parson",
"description": "Small json parser and reader", "description": "Small json parser and reader",
"keywords": [ "json", "parser" ], "keywords": [ "json", "parser" ],

View File

@ -1,8 +1,8 @@
/* /*
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
Parson 1.1.0 ( http://kgabis.github.com/parson/ ) Parson 1.1.1 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -960,7 +960,7 @@ static int json_serialize_to_buffer_r(const JSON_Value *value, char *buf, int le
if (is_pretty) { if (is_pretty) {
APPEND_STRING(" "); APPEND_STRING(" ");
} }
temp_value = json_object_get_value(object, key); temp_value = json_object_get_value_at(object, i);
written = json_serialize_to_buffer_r(temp_value, buf, level+1, is_pretty, num_buf); written = json_serialize_to_buffer_r(temp_value, buf, level+1, is_pretty, num_buf);
if (written < 0) { if (written < 0) {
return -1; return -1;

View File

@ -1,8 +1,8 @@
/* /*
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
Parson 1.1.0 ( http://kgabis.github.com/parson/ ) Parson 1.1.1 ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -2,7 +2,7 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
Parson ( http://kgabis.github.com/parson/ ) Parson ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 - 2020 Krzysztof Gabis Copyright (c) 2012 - 2021 Krzysztof Gabis
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal