Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement json_object_int_inc(json_object *, int64_t) #338

Closed
dpintaric opened this issue Jul 14, 2017 · 1 comment
Closed

implement json_object_int_inc(json_object *, int64_t) #338

dpintaric opened this issue Jul 14, 2017 · 1 comment

Comments

@dpintaric
Copy link

Hi,

Having json_object_set_int is great since I don't have to json_object_object_del() first but if I just want to inc the value I have to:

json_object_set_int(key_jobj, json_object_get_int(key_jobj) + 1);

Having json_object_inc_int() and json_object_inc_int64() would greatly optimize this when a interger object is beeing used as a counter.

@hawicz
Copy link
Member

hawicz commented Aug 31, 2017

Sure, sounds good to me. A pull request would be welcome.

hawicz added a commit that referenced this issue Nov 27, 2017
Issue #338, add json_object_add_int functions
@hawicz hawicz changed the title implement json_object_inc_int(json_object *) implement json_object_int_inc(json_object *, int64_t) Nov 27, 2017
@hawicz hawicz closed this as completed Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants