rethinkdb/rethinkdb — pull request #131 by Tryneus (2012-12-01 00:37:16+00:00)
Title: fixing cJSON comparison returning incorrect recursive result

When json_cmp was recursing in object compare due to two identical keys, it was returning the same result for `l < r` and `l > r`. This was due to the coercion of the result of json_cmp to a bool, where json_cmp can return -1, 0, or 1. Thus, a result of -1 was returning true (correct), a result of 0 was returning false (correct), and a result of 1 was returning true (incorrect).

This commit fixes that by performing the correct conversion to a bool.

Also, some std::strings were using in the comparison function, which I've changed to char *s, as they are in the original objects, to reduce allocation.