Make it safe to delete keys while iterating with the json_object_object_foreach macro.

This commit is contained in:
Eric Haszlakiewicz
2012-10-20 20:26:37 -05:00
parent 5abc0ea444
commit f6b27cbb6c
3 changed files with 36 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
==== delete-in-loop test starting ====
Key at index 0 is [foo1] (kept)
Key at index 1 is [foo2] (kept)
Key at index 2 is [deleteme] (deleted)
Key at index 3 is [foo3] (kept)
==== replace-value first loop starting ====
Key at index 0 is [foo1]
Key at index 1 is [foo2]
replacing value for key [foo2]