- if (db->state[db->depth].in_array) {
- if (ignore)
- db->state[db->depth].index++;
- else {
- char name[DATA_MAX_NAME_LEN];
- cj_cb_map_key (ctx, (unsigned char *)name,
- ssnprintf (name, sizeof (name),
- "%d", db->state[db->depth].index++));
- }
+ if (!db->state[db->depth].in_array)
+ return;
+
+ db->state[db->depth].index++;
+
+ if (update_key)
+ {
+ char name[DATA_MAX_NAME_LEN];
+
+ ssnprintf (name, sizeof (name), "%d", db->state[db->depth].index - 1);
+
+ cj_cb_map_key (ctx, (unsigned char *)name, (yajl_len_t) strlen (name));